I am curenttly using some code I found online and it is working.
I just have two issues that I would like to modify
1) I would like at add a FROM field so that the email comes from that email and not my email
2) I would like to format the "body" of the email in this fashion...
Dear Sir,
thanks for you interest.
Regards,
Me
here is the current code that I am using but just need to tweak..
code is below:
much appreciation, in advance...
I just have two issues that I would like to modify
1) I would like at add a FROM field so that the email comes from that email and not my email
2) I would like to format the "body" of the email in this fashion...
Dear Sir,
thanks for you interest.
Regards,
Me
here is the current code that I am using but just need to tweak..
code is below:
Code:
Private Sub Send_eMail_McKay_Guar_1_Click()
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set MyDb = CurrentDb
Set qdf = MyDb.QueryDefs("qrySHLMG1")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next
Set rsEmail = qdf.OpenRecordset()
Set oLook = CreateObject("Outlook.Application")
With rsEmail
.MoveFirst
Do Until rsEmail.EOF
myRecipient = .Fields(0)
If IsNull(myRecipient) = False Then
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.createitem(0)
With oMail
.to = "
.cc = "
.bcc = "
.body = "This is ONLY a TEST, See attached TEST"
.Importance = 2 'Importance Level 0=Low,1=Normal,2=High
.Subject = "THIS IS A Test Email"
.Attachments.Add ("C:\Users\jf\Documents\RPTTESTEXPORT\test.pdf")
.Send
End With
End If
.MoveNext
Loop
End With
Set oMail = Nothing
Set oLook = Nothing
End Sub