Name

Body — objNewMail .Body = strBody

Synopsis

A string value that represents the body content text of the current mail message.

Parameters

strBody

A string value that contains the text you want sent as the body of your message

Example

The following example demonstrates how to set the Body property for the current message.

<%

' Dimension local variables.
Dim objNewMail

' Instantiate a NewMail object.
Set objNewMail = Server.CreateObject("CDONTS.NewMail")

' Set the body string for the message.
objNewMail.Body = _
   "Wow, this message takes just a few lines of code."

' 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

The string you use to set the value of the Body property can contain either text or HTML. If you wish to use HTML in the Body property, you must set the BodyFormat property to reflect this content type. The possible values for BodyFormat are as follows:

Value

Description

0

The value in the Body property includes some HTML.

1

The value in the Body property includes only text.

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.