Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an Email from data on form 1

Status
Not open for further replies.

cgl04

Technical User
Apr 8, 2004
1
0
0
US
I am using the DoCmd.SendObject statement to create an email. I use a couple of user created functions to create the body and the email address list. The first time I hit the command button, everything works fine. The email is created with all of the correct information. However, if I close the email and hit the command button again, an email is not created a second time. The docmd.close statemnt runs but not the SendObject statement. I have to close out of the database and reopen for it to run correctly.

Is there a way around this?


Code:
lineSpace = Chr(13) & Chr(13)
  body = lineSpace & CreateMessage()
  subject = "Service Request"     
  eMailAddresses = PopulateEmail() &  EmailAddressesFromCheckBoxes()      
     
DoCmd.SendObject acSendNoObject, , , EmailAddresses, , , subject, body
DoCmd.Close


Thanks
 
hi,

The problem you are seeing is one of the challenges that came out of some of the Anti-Spam/Email security patches from MS.

The one of the ways around this is to code to use Outlook instead of SendObject. More coding involved but more consistent with executions.

also, be sure you have the latest MS office patch. I hear that MS "fixed" the SendObject in one of the latest patches but dont quote me. I havent seen it myself. Just an idea to check out...



Have A Great Day!!!, [bigglasses]

Nathan
Project Manager III
 
nathan1967: use Outlook instead of SendObject

No such luck. MS outdid themselves and hobbled Outlook too in the anti-spam : for each email to be sent, a pop-up will show to ask if you really really want to send that email.

Dimandja
 
hi Dimandja,

I agree. However, it would still allow you to send the email. The problem with SendObject is that it just fails completely.

The Outlook popup warning is annoying but it does allow for the email to go.

There just isn't a pretty solution anymore. :-(

Have A Great Day!!!, [bigglasses]

Nathan
Project Manager III
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top