HTML messages are sent as plain text
I'm using the following VBS function on an Intranet server to send messages. The Body parameter contains an HTML string. However, the message arrives as plain text, with the HTML source visible:
Sub Dir_SendMail(Sender, Recipient, Subject, Body)
Dim objMail
Set objMail = CreateObject("CDONTS.NewMail")
objMail.BodyFormat = 0 ' cdoBodyFormatHTML
objMail.From = Sender
objMail.To = Recipient
objMail.Subject = Subject
objMail.Body = Body
objMail.Send
Set objMail = Nothing
End Sub
I don't have cdovbs.inc and so found the value for cdoBodyFormatHTML by creating a VBA project, including CDONTS.DLL in the references and then typing ? cdoBodyFormatHTML in the Immediate window to produce the literal value 0.
What am I missing?
TIA,
Geoff
|