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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Email before sending

Status
Not open for further replies.

buckeyepilot67

Technical User
Jan 16, 2012
10
US
Ok, I know there was a thread regarding how to get your email to display before sending through access database. I changed the formatting for the body of the email to .HTMLBody and now the .Display at the end of the code does not work. Here is what I have after I have entered what I want in the body of the email.

objMessage.Subject = "Subject of Email"
objMessage.From = """XXX XXX""<XXX@XXX.com>"
objMessage.To = "XXX@XXX.com"
objMessage.CC = "XXX@XXX.com"
'objMessage.BCC = "XXX@XXX.com"


objMessage.Configuration.Fields.Item(" = 2
objMessage.Configuration.Fields.Item(" = "smtp.netjets.com"
objMessage.Configuration.Fields.Item(" = 25
objMessage.Configuration.Fields.Update
objMessage.Send

Like I said, instead of sending I would like Display the email message.
 
Ok, thanks for the reply, I was afraid of that. Now i am going back to the old coding where it lets me use .Display, but now I can't set who the email is from. Any chance I you can tell me what I am missing.

 
How about using DoCmd.SendObject ? It is not necessary to email an attacment with it and you have the choice of sending directly or editing the email first.
Code:
SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile)

EditMessage can be either True or False, True to edit before sending, false to send automatically. There is code to suppress the Outlook security warning if you prefer to do the automatic send.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top