I've currently got a system that sends out emails using SendObject, but as they are only rtf there is very little room for personalising them.
I've had a quick look on here about html emails and people are using:
Dim objOutlook As Outlook.Application
Dim objMsg As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objMsg = objOutlook.CreateItem(olMailItem)
With objMsg
.To
.Subject
.BodyFormat
.HTMLBody
.Display
.Send
End With
But when I attempt to send the email I get the error message 'User defined type not defined' in relation to the 1st line of code. What am I doing wrong?
I've had a quick look on here about html emails and people are using:
Dim objOutlook As Outlook.Application
Dim objMsg As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objMsg = objOutlook.CreateItem(olMailItem)
With objMsg
.To
.Subject
.BodyFormat
.HTMLBody
.Display
.Send
End With
But when I attempt to send the email I get the error message 'User defined type not defined' in relation to the 1st line of code. What am I doing wrong?