Encapsulates the AutoMate™ action in the “Email” group, “Check For Mail.” The method attempts to contact a POP3 server, login as the requested user, and check if any messages are waiting for retrieval.
Declaration
function CheckForMail (varServer As Variant,
varUsername As Variant,
varPassword As Variant,
intWaitingMailAction As Integer,
intNoWaitingMailAction As Integer) As Integer
Parameters
varServer
The hostname or IP address of the POP3 server to connect to.
varUsername
The username to use when connecting to the POP3 server.
varPassword
The clear text password to use for the username connecting to the POP3 server.
intWaitingMailAction
The action for AutoMate™ to take if there are any messages waiting for retrieval on the POP3 server:
Value |
Meaning |
0 |
Stop this task (method returns 2) |
1 |
Continue this task (method returns 0) |
intNoWaitingMailAction
The action for AutoMate™ to take if there are no messages waiting for retrieval on the POP3 server.
Value |
Meaning |
0 |
Stop this task (method returns 2) |
1 |
Continue this task (method returns 0) |
Description
The CheckForMail method will attempt to connect to the POP3 mail server specified by varServer as the user varUsername. It will then ask the POP3 server how many messages are in the user’s mailbox. If there are any messages waiting, AutoMate™ carries out the action specified by intWaitingMailAction. If there are no messages waiting, AutoMate™ carries out the action specified by intNoWaitingMailAction.
The CheckForMail method performs the intWaitingMailAction parameter if there are any messages waiting on the server, not necessarily if there are any unread messages.
The method returns different values based on the state of the POP3 mailbox and the parameters of intWaitingMailAction and intNoWaitingMailAction (see above). It return “1” if the POP3 server cannot be contacted.