Html emails

J

John

Hi

I am using the following code from my vb.net app to send html emails via
outlook.

objOutlook = CreateObject("Outlook.Application")
objOutlookMsg = objOutlook.CreateItem(Outlook.OlItemType.olMailItem)
fso = CreateObject("Scripting.FileSystemObject")
ts = fso.OpenTextFile(m_objParentForm.txtHtml.Text.ToString, 1)
eMessage = ts.ReadAll
With objOutlookMsg
eto = "(e-mail address removed)"
objOutlookRecip = .Recipients.Add(eto)
objOutlookRecip.Type = Outlook.OlMailRecipientType.olTo
.Subject = "My Subject"
.HTMLBody = eMessage
.Send()
End With
objOutlook = Nothing

The problem is that bodies of emails are coming out blank, where there
should be html read from file. What am I doing wrong?

Thanks

Regards
 
S

Sue Mosher [MVP]

Outlook version?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
J

John

Outlook 2002. Although I would like to keep everything ol200 and above
compatible.

Thanks

Regards


Outlook version?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top