PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview of POP3/SMTP protocols
  • The POP3 and SMTP protocols
  • Principle
  • Sending messages by using the SMTP protocol
  • Receiving messages by using the POP3 protocol
  • Remarks
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
Overview of POP3/SMTP protocols

The POP3 and SMTP protocols

  • The POP3 protocol (Post Office Protocol) is used to receive emails.
  • The SMTP protocol (Simple Mail Transfer Protocol) is used to send emails.
Remarks:
  • The reception of emails can also be taken into account by using the IMAP protocol.
  • AndroidAndroid Widget iPhone/iPad The SSL connections are supported.
Versions 17 and later
iPhone/iPad This feature is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is now available for iPhone/iPad applications.
iPhone/iPad This feature is now available for iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This feature is now available in Android Widget mode.
Android This feature is now available for Android applications.
New in version 22
Android Widget This feature is now available in Android Widget mode.
Android This feature is now available for Android applications.
Android Widget This feature is now available in Android Widget mode.
Android This feature is now available for Android applications.
Principle

Sending messages by using the SMTP protocol

To send messages by using the SMTP protocol, you must:
  1. Start an SMTP session:
  2. Build the message to send in an Email variable variable or in the Email structure.
  3. Send the message with EmailSendMessage.
  4. Close the SMTP session with EmailCloseSession.

Receiving messages by using the POP3 protocol

To receive emails by using the POP3 protocol, you must:
  1. Start a POP3 session:Example for starting a session by using an emailPOP3Session variable:
    // Ouverture de la session de messagerie
    MaSession is emailPOP3Session
    MaSession.ServerAddress = "pop.masociete.fr"
    MaSession.Name = "utilisateur"
    MaSession.Password = "secret"
    EmailStartSession(MaSession)
  2. Read the messages on the messaging server:
    • with the EmailGetAll function,
    • with a loop such as:
      • Example that is using an Email variable:
        MonMessage is Email
        EmailReadFirst(MaSession, MonMessage)
        WHILE NOT MonMessage.Out
        // Placer ici le traitement du message lu...
        ...
         
        EmailReadNext(MaSession, MonMessage)
        END
      • Example that is using the Email structure:
        EmailReadFirst(MaSession)
        WHILE NOT Email.Out
        // Placer ici le traitement du message lu...
        ...
         
        EmailReadNext(MaSession)
        END
    • or with a loop such as:
      MonMessage is Email
      FOR EACH MonMessage OF MaSession
      // Placer ici le traitement du message lu...
      ...
      END
  3. Close the POP3 session with EmailCloseSession.
Remark: A POP3 session and an SMTP session can be simultaneously started by EmailStartSession.
Remarks
Related Examples:
The POP3 Email functions Unit examples (WINDEV): The POP3 Email functions
[ + ] Using the Email functions to manage the POP3 protocol.
This protocol is used to retrieve emails from a server.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment