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

Send Email with specific message in the body

Status
Not open for further replies.

WB786

MIS
Mar 14, 2002
610
0
0
I would like to set up a button on my form that when clicked it would query the terminated employee(s) and then send an email to pre-defined people and would populate the send to box to whom the message going to and the subject saying "These are the current terms....". Any help would be appreciated. Thanks in advance.

-WB
 
Hi,

I've had great success using the following example. I use the e-mail facility for a risk assessment database which ensures all the management team are kept informed.

Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Set objMail = objOutlook.CreateItem(olMailItem)
With objMail
.Recipients.Add "joe.blogs@email.com"
.Recipients.Add "john.doe@email.com"
.Recipients.Add Responsible
.Subject = "Non-conformance set to PENDING"
.Body = "The following corrective action has been completed and the non-conformance set at PENDING" & Chr(13) & Chr(13) _
& "Nonconformance: RACA" & CA_Select_Hazard_ID & Chr(13) & Chr(13) _
& "Nonconformance Details: " & Text65 & Chr(13) & Chr(13) _
& "Responsible: " & Text60 & Chr(13) & Chr(13) _
& "Corrective Action: " & Corrective_Action & Chr(13) & Chr(13) _
& "Target Completion Date: " & Target_CA_Date & Chr(13) & Chr(13) _
& "Actual Completion Date: " & Actual_CA_Date & Chr(13) & Chr(13) _
& "Approvers: Please review the above corrective action and set the status to CLOSED or back to OPEN"
.Send
End With
Set objMail = Nothing
Set objOutlook = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top