Emailing from a Form

G

Guest

I am displaying an email address on a form and want to use that to email
direct from my code. I am using the previously recommended code but am unsure
how to reference my field name in code. It can't be this simple surely.
....
With objEmail
.To = "me.[SalesEmail]"
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
.ReadReceiptRequested
End With
 
G

Guest

If I may add to this question...

Is there a way to just click on an e-mail address in a table and/or a form,
similar to the HTML mailto: command?
 
K

KML

Is SalesEmail the name of the control with the email address?

If it is, try this:

With objEmail
.To = me.SalesEmail.Value
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
.ReadReceiptRequested
End With
 

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