July 2000
Intermediate to advanced
492 pages
14h 53m
English
BodyFormat —
objNewMail
.BodyFormat =
intFormatType
An integer value that you can use to set whether the content of the current message is plain text or HTML.
intFormatType
An integer that can be set to either of the following constants:
CdoBodyFormatHTML(0)
The Body property represents HTML.
CdoBodyFormatText (1)
The Body property represents plain text.
The following example demonstrates how to set the BodyFormat property for the current message:
<%
' Dimension local variables.
Dim objNewMail
Dim strBodyContent
' Instantiate a NewMail object.
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
' Set the body string for the message.
strBodyContent = _
"<HTML><HEAD><TITLE>My HTML Content</TITLE></HEAD><BODY>"
strBodyContent = strBodyContent & _
"Wow, this message takes just a few lines of code.</BODY>"
' Set the BodyFormat so that the NewMail object
' treats the body contents as HTML.
objNewMail.BodyFormat = cdoBodyFormatHTML
ojbNewMail.MailFormat = cdoMailFormatMIME
' Set the body content string for the NewMail object.
objNewMail.Body = strBodyContent
' Send the message. For details about the Send method,
' see that section in this chapter.
objNewMail.Send "me@here.com","you@there.com", _
"This is the subject",,cdoHigh
%>If you do not set the BodyFormat property, the default is
cdoBodyFormatText.
Read now
Unlock full access