|
|
|
|
|
How to read emails via the POP3 protocol?
To read emails via the POP3 protocol without using a messaging software, you must: - Retrieve the parameters for connecting to your POP3 server (these parameters are supplied by your Internet Service Provider or by your network administrator). These parameters must be stored via an emailPOP3Session variable.
- Connect to the POP3 server via EmailStartPOP3Session.
- Perform a loop to read the emails from the beginning to the end by using EmailReadFirst and EmailReadNext. The Email.Out variable is set to:
- True if there are no more messages to read.
- False otherwise.
- Use an Email variable to retrieve the content of email that was read.
- Close the POP3 session by using EmailCloseSession.
MyMessage is Email
MyPOP3Session is emailPOP3Session
MyPOP3Session.ServerAddress = "pop3.mycompany.us"
MyPOP3Session.Name = "user"
MyPOP3Session.Password = "secret"
IF NOT EmailStartSession(MyPOP3Session) THEN
Error("Unable to start the POP3 session.", ErrorInfo())
ELSE
EmailReadFirst(MyPOP3Session, MyMessage)
WHILE NOT Email.Out
Trace(MyMessage.Subject, MyMessage.Sender, MyMessage.Message)
EmailReadNext(MyPOP3Session, MyMessage)
END
EmailCloseSession(MyPOP3Session)
END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|