Html emails

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
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
 
Back
Top