email from form

B

Bill

I saw some similar requests on the board but I think they
are more complicated and involve networks.

I merely have a form with customers names and email
addresses and would like to create an event that sends a
form letter (not mail merged) to that recipient.

This sounds simple but my since I only code every couple
of months when the personal need arises, I'm not very
proficient. Is there some code somewhere I can copy, paste
an maybe slightly modify (field names)?

Bill
 
D

Damon Heron

Hi Bill,
I briefly answered you in your other post, but here is some simple code that
uses Outlook Express, in my case, to send an email msg. I put it in the
doubleclick event of a text box with the email address in it. Look at the
SendObject help in VBA. The true or false parameter allows you to edit
email or send directly. If you list an object, then it sends as an
attachment, not in the body of the email, so I omitted the objectname and
type.

Private Sub EmailName_DblClick(Cancel As Integer)
Dim strEmail As String
Dim Testtxt As String
Testtxt = "This is the test text of the email to send. It can go on for
several pages as you can see. What I want to say is...." & vbCrLf
Testtxt = Testtxt & "Another Line." & vbCrLf
Testtxt = Testtxt & "Last Line." & vbCrLf

strEmail = Me.[EmailName]
DoCmd.SendObject , , , strEmail, , , "Test", Testtxt, True

end Sub

HTH
Damon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top