Sending email from Microsoft Access 2003

S

scottmfitzge

Hi i wonder if someone is able to help me, i want to create a button on a
form that sends an email to two addresses held on the form, but i also want
to specify the account which the email is sent from and also want to draw
other fields from the form into the main body of the email - any ideas?
 
A

Arvin Meyer [MVP]

Creating the button is easy enough, so is sending to multiple email
addresses. The hard part is sending from a different profile that what you
already are logged in as. By default, no email program does that. Some of
the more expensive spam programs may allow that.

If you just want to send email using the default mail client, look up
SendObject, in the helpfiles. For specifics using Outlook, have a look at my
code at:

http://www.datastrat.com/Code/OutlookEmail.txt
 
C

cemal

'Dim stDocName As String
'stDocName = "RequestsReportbyEmail"
'DoCmd.SendObject acReport, stDocName, acFormatSNP

'Defining variables
Dim ssubject
Dim smessage
Dim eto, mcc
'Below email address are the real address that program uses.

'Delete the single qouta from below 2 lines in order to send test e-mail to
yourself.
'eto = "emailaddress"
'mcc = "emailaddress"
'bcc = "emailaddress"


'Checking to see reimage the unit checkbox is selected or not.
'If selected checkboxselection variable set to Yes for later use
If Me.ckbreimage.Value = True Then
checkboxselection = "Yes"
Else
checkboxselection = "No"
End If



ssubject = "replacement request for dealer # " & Me!txtdealernumber
smessage = "Dealer Number : " & Me.txtdealernumber & vbCrLf & _
"Dealer Address : " & Me.txtdealeraddress & vbCrLf & _
"Expected Date :" & Me.txtexpecteddate & vbCrLf & _
"Contact : " & Me.txtcontact & vbCrLf & _
"Phone : " & Me.txtphone & vbCrLf & _
"Unit model # " & Me.txtunitmodel & _
vbCrLf & "Unit serial # : " & Me.txtunitserialnumber & vbCrLf & _
"Part Number # : " & Me.Combo37 & vbCrLf & _
"repair (panasonic instructions) :" & Me.txtrepair & vbCrLf & _
"reimage yes/no : " & checkboxselection & vbCrLf & _
"special instructions :" & Me.txtnotes
DoCmd.SendObject acSendNoObject, , , eto, mcc, bcc, ssubject, smessage, False
 

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