AddCc

Description

Adds the e-mail address of a carbon-copy recipient to the mail message.

Call this method once for every e-mail address you want to add to the carbon-copy list. Each person you add to this list receives a copy of the e-mail message. Addresses on the carbon-copy list appear in the header of the e-mail message.

Syntax

VBScript


MailMsg.AddCc newAddress 

Perl


$MailMsg->AddCc(newAddress); 
Identifier
Description
MailMsg
A Mail Message object, representing the mail message to be sent.
newAddress
A String containing the e-mail address of the recipient.
Return value
None.

Examples

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 

Perl


use CQPerlExt;

# Session and logon needed if GetUserEmail is used. For example, 
# my $sessionObj = CQSession::Build();
# $sessionObj->UserLogon( $loginname, $password, $dbName, "" );

my $mailmsg = CQMailMsg::Build();

# there is currently no SetFrom method for CQPerl

$msg_to = 'admin@us.hcl.com';
$mailmsg->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();
$mailmsg->AddCc($msg_cc);

$msg_subject = "Hello";
$mailmsg->SetSubject($msg_subject);

$msg_body = "This message brought to you from cqperl!\n";
$mailmsg->SetBody($msg_body);

$mailmsg->Deliver();

CQMailMsg::Unbuild($mailmsg);
# CQSession::Unbuild($sessionObj);