メール メッセージの戻りアドレスを設定します。
CQMailMsg オブジェクトを使用して、電子メールを送信する場合
CQMailMsg オブジェクトはフックで使用でき、フックは Web サーバーまたはインストールされている ClearQuest® クライアントで実行できます。この 2 つのケースではプロセス ID が同じでないことがあるので、メール転送エージェント (Windows の場合) または sendmail プログラム (UNIX システムおよび Linux の場合) が送信元アドレスを判別するために使用できる情報が、この 2 つの場合で異なることがあります。 SetFrom メソッドを使用すると名前 (Session オブジェクトの GetUserEmail メソッドの戻り値など) を指定できますが、メール転送エージェントまたは sendmail 構成でその値を変更または置換することがあります。
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