Name
From —
objNewMail
.
From =
strSenderAddr
Synopsis
A string value that represents the full messaging address of the sender of the current message.
Parameters
-
strSenderAddr A string value containing the messaging address of the person or process that is sending the current NewMail object. This address is not resolved (checked) before it is placed in the mail header sent with the NewMail object.
Example
This example demonstrates the use of the From property. It also shows that if you set the From property and also include a From string in the Send method call, the setting you used for the From property is ignored and only the string sent to the Send method is actually used.
<%
' 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."
' Set the From property to the sender's email address.
objNewMail.From = "sender@usacom.com"
' Send the message. For details about the Send method,
' see that section in this chapter.
' NOTE: Because we are including a value for the From
' parameter to the Send method call, the value here
' is actually sent to the message's recipient.
objNewMail.Send "me@here.com","you@there.com", _
"This is the subject",,cdoHigh
%>Notes
If you set the value of the From property and then also include a From parameter in your call to the NewMail object's Send method, the argument sent as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access