Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.MailLogon Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Logs on to a MAPI mail system and establishes a mail session. A mail session must be established before mail or document routing methods can be used.

Syntax

expression. MailLogon( ** Name, ** Password, ** DownloadNewMail** )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
NameOptionalStringThe mail account name.
PasswordOptionalStringThe mail account password.
DownloadNewMailOptionalBooleanTrue if new mail is downloaded immediately.

Remarks

Previously established mail sessions are logged off before an attempt is made to establish the new session. Omit both Name and Password to use the default mail session for the system.

Example

The following example logs on to the mail system and downloads any new mail.

Sub SessionLogon() 

 If IsNull(MailSession) Then 
 Application.MailLogon "oscarx", "mypassword", True 
 End If 

End Sub
© 2018 Microsoft