mailAddress PowerScript function
Description
Updates the mailRecipient array for a mail message.
Controls
mailSession object
Syntax
|
1 |
<span>mailsession</span>.<span>mailAddress</span> ( { <span>mailmessage </span>} ) |
|
Argument |
Description |
|---|---|
|
mailsession |
A mailSession object identifying the |
|
mailmessage (optional) |
A mailMessage structure containing information |
Return Values
mailReturnCode. Returns one of the following values:
-
mailReturnSuccess!
-
mailReturnFailure!
-
mailReturnInsufficientMemory!
-
mailReturnUserAbort!
If any argument’s value is null, mailAddress returns null.
Usage
The mailRecipient array contains information about recipients
of a mail message or the originator of a message. The originator
is not used when you send a message.
If there is an error in the mailRecipient array, mailAddress displays
the Address dialog box so the user can fix the address. If you pass
a mailMessage structure that is a validly addressed message (such
as a message that the user received) nothing happens because the
addresses are correct.
If you do not specify a mailMessage, the mail system displays
an Address dialog box that allows users to look for addresses and
maintain their personal address list. The user cannot select addresses
for addressing a message.
Before calling mail functions, you must declare and create
a mailSession object and call mailLogon to establish
a mail session.
Examples
These statements create a mail session, send mail
with an attached TXT file, and then log off the mail system and
destroy the mail session object:
|
1 |
mailSession mSes |
|
1 |
mailReturnCode mRet |
|
1 |
mailMessage mMsg |
|
1 |
mailFileDescription mAttach |
|
1 |
// Create a mail session |
|
1 |
mSes = CREATE mailSession |
|
1 |
// Log on to the session |
|
1 |
mRet = mSes.mailLogon(mailNewSession!) |
|
1 |
IF mRet <> mailReturnSuccess! THEN |
|
1 |
MessageBox("Mail", 'Logon failed.') |
|
1 |
RETURN |
|
1 |
END IF |
|
1 |
mMsg.AttachmentFile[1] = mAttach |
|
1 |
mRet = mSes.<span>mailAddress</span>(mMsg) |
|
1 |
IF mRet <> mailReturnSuccess! THEN |
|
1 |
MessageBox("Mail", 'Addressing failed.') |
|
1 |
RETURN |
|
1 |
END IF |
|
1 |
// Send the mail |
|
1 |
mRet = mSes.mailSend(mMsg) |
|
1 |
IF mRet <> mailReturnSuccess! THEN |
|
1 |
MessageBox("Mail", 'Sending mail failed.') |
|
1 |
RETURN |
|
1 |
END IF |
|
1 |
mSes.mailLogoff() |
|
1 |
DESTROY mSes |