SetFrom

Sets the return address of the mail message.

Description

Remarque : This method is for VBScript only. It is not available for Perl.

When using a CQMailMsg object to send e-mail:

The CQMailMsg object can be used in a hook, and the hook may execute on a Web server or an installed ClearQuest client. Since the process identity of these two cases may not be the same, the information available to the mail transport agent (for Windows) or sendmail program (for the UNIX system and Linux) to determine what goes in the From address may be different for these two situations. You can use the SetFrom method to specify a name (such as the return value of the GetUserEmail method of the Session object), but the mail transport agent or sendmail configuration may modify or replace that value.

Remarque : The SetFrom method has no effect when using MAPI. When sending SMTP email on a Web server, the server name and domain may be included in the "From" part of the message (depending how the sendmail program is configured) instead of the Rational ClearQuest user email address, unless SetFrom is explicitly used.
Avertissement : La prise en charge de Rational ClearQuest Email 1.x et de MAPI n'est plus assurée. For enhanced email support, use the EmailPlus 2.1 package. Pour plus d'informations, voir Package EmailPlus.

Syntaxe

VBScript

MailMsg.SetFrom returnAddress 
Identificateur
Description
MailMsg
A Mail Message object, representing the mail message to be sent.
returnAddress
A String containing the email address to add to the From field of the mail message.
Valeur renvoyée
Aucune.

Exemples

VBScript

Dim OleMailMsg

' Session and logon needed if GetUserEmail is used. Par exemple, 
' Dim sessionObj
' Set sessionObj = GetSession
' sessionObj.UserLogon loginname, password, dbName, AD_PRIVATE_SESSION, ""

Set OleMailMsg = CreateObject("PAINET.MAILMSG")

msg_from = "admin@example.com"
OleMailMsg.SetFrom(msg_from)

msg_to = "admin@example.com"
OleMailMsg.AddTo(msg_to)

' You must log in to a database session if GetUserEmail is used.
msg_cc = "user_email_address"
' Or this: msg_cc = sessionObj.GetUserEmail
OleMailMsg.AddCc(msg_cc)

msg_subject = "Hello"
OleMailMsg.SetSubject(msg_subject)

msg_body = "This message brought to you from cqole!\n"
OleMailMsg.SetBody(msg_body)

OleMailMsg.Deliver 

Feedback