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.
VBScript
MailMsg.SetFrom returnAddress
VBScript
Dim OleMailMsg
' Session and logon needed if GetUserEmail is used. For example,
' 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