How can I check if email was sent?

pepok4

Registered User.
Local time
Tomorrow, 00:40
Joined
Jan 10, 2013
Messages
14
Hi all,
I need help with sending email using VBA & HTML. I want send email from access. Message in body contains some text and table in HTML format. I need check if email was really sent or cancelled with user.
Thanks in advance.

Code:
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)

    With objMail
        'Set body format to HTML
        .To = Me.To
        .Subject = Me.Subject
        .BodyFormat = olFormatHTML
        .HTMLBody = "<HTML><BODY>" & sTblBody & " </BODY></HTML>"
        .Display
        
    End With
I need some message (for example):
If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If
 

Users who are viewing this thread

Back
Top Bottom