Name
BodyFormat —
objNewMail
.BodyFormat =
intFormatType
Synopsis
An integer value that you can use to set whether the content of the current message is plain text or HTML.
Parameters
-
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.
-
Example
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 %>
Notes
If you do not set the BodyFormat property, the default is
cdoBodyFormatText
.
Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.