Cicode Programming Reference > Cicode Function Categories > Mail Functions Introduction > MailLogon


Logs on to the mail system. You need to call this function before any other mail function.

The mail system uses the MAPI standard interface, so you can use any mail system that supports this standard.

You should log on to the mail system when CitectSCADA starts, and log off only at shutdown. (The logon procedure can take a few seconds to complete.) You can only log on as one user at a time for each computer, so you can only read mail for this user name.


MailLogon(sName, sPassword, iMode)


The name of the mail user. This name is the user's mail box name (the unique shorthand name, not the full user's name).


The password of the mail user.


The mode of the logon:

0 - Normal logon.

2 - Get unique logon, do not share existing mail client logon.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

MailLogoff, MailSend, MailRead, MailError


! Send the report to James
MailLogon("RodgerG", "password", 0);
MailSend("James Glover", "Report", "This is the weekly report", "[data]:weekly.txt", 0);

See Also

Mail Functions