|
|
|
|
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 is no message 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 // Simple POP3 session MyPOP3Session.ServerAddress = "pop3.mycompany.us" MyPOP3Session.Name = "user" MyPOP3Session.Password = "secret" // Start the POP3 session IF NOT EmailStartSession(MyPOP3Session) THEN // Error starting the IMAP session Error("Unable to start the POP3 session.", ErrorInfo()) ELSE // Read the messages EmailReadFirst(MyPOP3Session, MyMessage) WHILE NOT Email.Out // Process the message read Trace(MyMessage.Subject, MyMessage.Sender, MyMessage.Message) // Read the next message EmailReadNext(MyPOP3Session, MyMessage) END // Disconnect from the session EmailCloseSession(MyPOP3Session) END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|