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.
I need some message (for example):
If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If
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
If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If