473,413 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

SendObject - only works once!

I am using send object to generate emails BUT it works once then not again until I close and reopen my application.

Thus in the code below only 1 email is generated - doesn't matter which of the docmd.SendObject lines comes first. Repeat the function - no emails generated. Close access, reopen - one email is generated!

?? Any suggestions ??

** code snippet **
Expand|Select|Wrap|Line Numbers
  1.    sendTo = "DummyOne1@Blueyonder.co.uk"
  2.          DoCmd.SendObject objectType, objectName, outputformat, "DummyAddressx@Blueyonder.co.uk", sendCc, sendBcc, sendSubject, sendMessage, editmessage, templateFileName
  3.         DoCmd.SendObject objectType, objectName, outputformat, sendTo, sendCc, sendBcc, sendSubject, sendMessage, editmessage, templateFileName
** end code **
Feb 28 '07 #1
4 3062
nico5038
3,080 Expert 2GB
This is a known problem.
One solution is to switch to work with the MAPI, but this "shell" solution can be used too:
Expand|Select|Wrap|Line Numbers
  1. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  2.  
  3. mail_to="abc@your.com"
  4. mail_cc="abc@your.com"
  5. mail_sub="The solution in the subject"
  6. mail_txt = "here's your text " & "%0D" & "%0D"
  7. mail_txt = mail_txt & "and a second line" & "%0D" & "%0D"
  8.  
  9. ShellExecute(0&, vbNullString, "mailto:" & mail_to & "?subject=" & mail_sub & "&cc=" & mail_cc & "&body=" & mail_txt, vbNullString, "C:\", 1)
  10.  
Nic;o)
Feb 28 '07 #2
NeoPa
32,556 Expert Mod 16PB
Nico,
What protocol does ShellExecute use to send the mail?
I have loads of restrictions for SMTP in my network so I need to know if it will be subject to those restrictions.
TIA -Adrian.

PS Is there somewhere I can find more details on it?
Apr 11 '07 #3
pks00
280 Expert 100+
Hi Nico mate, how are ya doing. Its been a while. How is work for you now. Working locally now arent you? Im doing the mega trek now. Working away from home, about 120miles away but takes about 3hrs so I stay overnight, 6hrs a day commuting is just too much

Anyways, regarding emails, what version Access are you using. Are you using 2003? are you getting those security popups coming up?

Do you know the smtp address? Have u considered using something like CDO?
I got sample code for that if u are interested.

The other alternative is to use outlook automation. Now u would get the security popup if u are using 2003. I can give examples if you like.

A similar thing to outlook automation but no security popups is redemption http://www.dimastr.com/redemption/
Apr 11 '07 #4
Denburt
1,356 Expert 1GB
For Outlook security warnings you may want to check out this thread.

http://www.thescripts.com/forum/thre...8740-2-10.html

I have been in a number of environments where they had things locked down super tight but I have almost always had success with using CDO.

I wanted to mention that I have used the redemption component also and it can come in handy for some things.
Apr 11 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rodger | last post by:
hi all, I have a form with two text boxes, a go button and a formula in the code to perform a calculation a value is entered in one text box, and press buttonm a result is computed which is...
4
by: Brandon | last post by:
I'm using an istringstream to convert some integers stored in string form to integers. However, each integer is stored in a differnt string. So, I used istringstream's str(string) method for the...
2
by: Isabel | last post by:
hi everyone, I have an annoying problem of with asp. Right now, when i type in data in textbox and hit submit, the text entered stays displayed in the textbox, however if I type in new data, it...
1
by: Kitchen Bin | last post by:
Hi. I am trying to use Sockets to do multiple Send and Receives via HTTP (not simultaneously). A first pair of Send/Receives works fine and sure enough I receive HTML back, but the next...
3
by: trint | last post by:
Ok, MoveNext is only moving to the next record once, then it stays on that record unless I use these (which work just fine) MoveLast MoveFirst MovePrevious. private void btnNext_Click(object...
0
by: Mike Caputo | last post by:
Having some trouble with SMTPMail... I can get it to send once, then I try again, and it goes through without an error, but nothing gets sent. The message has one attachment - a fairly large Zip...
2
by: Jeff | last post by:
I am creating an ASP.NET 2.0 application that I want to embed a Windows Control into. Here are the steps: 1) I created a new Windows Control Library with a simple "hello world" app. 2) Compiled...
2
by: Frederic Rentsch | last post by:
Hi all, I have a class Time_Series derived from list. It lists days and contains a dictionary of various Lists also derived from list which contain values related to said days. (e.g. Stock...
5
by: makthar | last post by:
Hi I have a JSP that calls an Ajax function when a button is clicked. The Ajax function calls a servlet . The Ajax function works well in Mozilla , but in IE7 when the button is clicked it works...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.