mailLogon PowerScript function
Description
Establishes a mail session for the PowerBuilder application.
The PowerBuilder application can start a new session or join an
existing session.
Controls
mailSession object
Syntax
|
1 |
<span>mailsession</span>.<span>mailLogon</span> ( { <span>profile</span>, <span>password</span> } {, <span>logonoption</span> } ) |
|
Argument |
Description |
|---|---|
|
mailsession |
A mailSession object identifying the |
|
profile (optional) |
A string whose value is the user’s |
|
password (optional) |
A string whose value is the user’s |
|
logonoption (optional) |
A value of the mailLogonOption enumerated
The default is to use an existing session if possible and |
Return Values
mailReturnCode. Returns one of the following values:
-
mailReturnSuccess!
-
mailReturnLoginFailure!
-
mailReturnInsufficientMemory!
-
mailReturnTooManySessions!
-
mailReturnUserAbort!
If any argument’s value is null, mailLogon returns null.
Usage
If you do not direct mailLogon to start
a new session and the mail application is already running on the
user’s computer, then the PowerBuilder mail session attaches
to the existing session. A profile and password are not necessary.
When mailLogon establishes a new session,
then the mail system’s dialog box prompts for the profile
and password if the script does not supply them.
The download option forces the mail server to download the
latest messages to the user’s inbox. This ensures that
the inbox is up to date; it does not make the messages available
to PowerBuilder. To access messages, use mailGetMessages and mailReadMessage.
Before calling mailLogon, you must declare
and create a mailSession object.
Examples
In this example, the mailSession object new_session is
an instance variable of the window. The window’s Open event
script allocates memory for the mailSession object and logs on.
During the logon process, the mail application displays a dialog
box prompting for the profile and password:
|
1 |
new_session = CREATE mailSession |
|
1 |
new_session.<span>mailLogon</span>(mailNewSession!) |
This example establishes a new mail session and makes
the user’s inbox up to date. The user wo not be prompted
for an ID and password because user information is provided. Here
the mailSession object is a local variable:
|
1 |
mailSession new_session |
|
1 |
new_session = CREATE mailSession |
|
1 |
new_session.<span>mailLogon</span>("jpl", "hotstuff", & |
|
1 |
mailNewSessionWithDownLoad!) |