mailAddress

Description

Updates the mailRecipient array for a mail message.

Applies to

mailSession object

Syntax

mailsession.mailAddress ( { mailmessage } )

Argument

Description

mailsession

A mailSession object identifying the session in which you want to address the message.

mailmessage (optional)

A mailMessage structure containing information about the message. If you omit mailmessage, mailAddress displays an Address dialog box.


Return value

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:

mailSession mSes
mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach
// Create a mail session
mSes = CREATE mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
    MessageBox("Mail", 'Logon failed.')
    RETURN
END IF
  mMsg.AttachmentFile[1] = mAttach
  mRet = mSes.mailAddress(mMsg)
IF mRet <> mailReturnSuccess! THEN
    MessageBox("Mail", 'Addressing failed.')
    RETURN
END IF
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
    MessageBox("Mail", 'Sending mail failed.')
    RETURN
END IF
mSes.mailLogoff()
DESTROY mSes

See also

mailLogoff

mailLogon

mailResolveRecipient

mailSend