Name

Value — objNewMail .Value (strHeaderName) = strHeaderValue

Synopsis

A string value that represents an additional header to be added to the mail message. The Value property allows you to set the value of this header.

Parameters

strHeaderName

A string containing the name of the header you wish to add to your mail message

strHeaderValue

A string containing the value of the header represented by strHeaderName

Example

The following example demonstrates how to use the Value property to add a new header to your current message.

<%

' Dimension local variables.
Dim objNewMail
Dim strRecipList

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

' Set the Value property to add a ReplyTo header to 
' the current message before it is sent.
objNewMail.Value("ReplyTo") = "Keyton<me@here.com>"

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

' Send the message. For details on the Send method,
' see that ssection in this chapter
objNewMail.Send "me@here.com","you@there.com", _
   "This is the subject",,cdoHigh

%>

Notes

The Value property of the NewMail object should be used sparingly and only when you know with certainty that the receiving mail messaging system will process the added header(s) correctly.

You can set the value of a header more than once. However, this does not overwrite the first value, but rather adds a second header with the second value.

The header name you include must match exactly what ...

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.