Saving Emails

gsrajan

Registered User.
Local time
Today, 05:32
Joined
Apr 22, 2014
Messages
227
Is there a way to save the emails sent with docmd.sendobject method? I wish to save the Date Sent, To, Subject and the message body in a table (tblEmail) in the fields DateSent, To, Subject and MessageBody.

Thanks for your help.
 
Hmm, going to need some details to see the best solution...

How are you sending the eMails, i.e. are you opening a Form and then the Users click send or are you sending the same eMail all the time?
 
Something along these lines, modifying to suit your needs of course.

Dim strSQL As String

strSQL = "INSERT INTO tblEmail (lrptdte,lsentto,lsubject,lmessage,lbcc) "
strSQL = strSQL & "VALUES (#" & Me.rdtesent & "#,'" & Me.EmailTo & "','" & Me.EmailSubject & "','" & Me.EmailMessage & "','" & "','""')"


CurrentDb.Execute strSQL, dbFailOnError

HTH
 
Hi GinaWhipp,

The mails goes from the command button click event. "To" is static email id, does not change. The "Subject" is user's first name and last name ( capturing from Text Boxes - txtFirstName and txtLastName), message body is captured from txtMessage textbox. In every repeated email, only the message body changes. If the email is sent 10 times, I need to have 10 records in the table. The user does not see the email, it is "acnoedit" email.

Hi Burrina,

I think this will work for me.

I will try this one.

Thanks to you both.
 

Users who are viewing this thread

Back
Top Bottom