ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / How to proceed? / Programming
  • Principle
  • Example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Principle
To read emails via the POP3 protocol without using a messaging software, you must:
  1. 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.
  2. Connect to the POP3 server via EmailStartPOP3Session.
  3. 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.
  4. Use an Email variable to retrieve the content of email that was read.
  5. Close the POP3 session by using EmailCloseSession.
Example
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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/27/2022

Send a report | Local help