Sending HTML Emails

hydeyho

Registered User.
Local time
Today, 00:05
Joined
Mar 1, 2007
Messages
31
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?
 
You need to set a reference to the Outlook library. In the VBA IDE (code window), go to Tools > References and put a checkbox next to Microsoft Outlook.
 
Thanks, I knew it needed to be referenced somewhere but I didn't know how to do it
 

Users who are viewing this thread

Back
Top Bottom