Name

Subject — objNewMail . Subject = strSubjectString

Synopsis

The string that will be sent as the subject line for the current mail message.

Parameters

strSubjectString

A string that holds the subject line to be sent with the message. This can be set to an empty string, but doing so defeats the purpose of the subject line.

Example

<%

' Dimension local variables.
Dim objNewMail
Dim strRecipList

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

' Set the Subject property.
objNewMail.Subject = "RE: An important note for you"

' 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. Note that the 
' subject parameter is not sent.
objNewMail.Send "me@here.com","you@there.com", _
   "This is the subject",,cdoHigh

%>

Notes

You should always set the Subject property of a NewMail object (or include a subject parameter in the call to the Send method for the current message).

If you set the Subject property of the NewMail property and also supply a subject argument when calling the Send method, the argument value is used and the Subject property setting is ignored.

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.