I would like to add a flag which verify that the email was sent or at least is in the Sent Outlook folder to the following vba code.
Thanks
Norbert
Code:
Private Sub cmdEmail1_Click()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Dear Aaron," & vbNewLine & "Enclosed is the requested information"
On Error Resume Next
With OutMail
.To = "drnorbert@msn.com"
.CC = ""
.BCC = ""
.Subject = "Important..."
.Body = strbody
.SendUsingAccount = OutApp.Session.Accounts.Item(2) '2nd email
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Norbert