PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
This content comes from an automatic translation.
  • 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
  • Principle and specific features in WINDEV
  • Principle and specific features in WEBDEV
  • Remarks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
  • WEBDEV - Server codeWindowsLinux The SSL connections are supported.
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:
    // Start the messaging session
    MySession is EmailPOP3Session
    MySession..ServerAddress = "pop.mycompany.us"
    MySession..Name = "user"
    MySession..Password = "secret"
    EmailStartSession(MySession)
  2. Read the messages on the messaging server:
    • by EmailGetAll,
    • with a loop such as:
      • Example that is using an Email variable:
        MyMessage is Email
        EmailReadFirst(MySession,MyMessage)
        WHILE NOT MyMessage..Out
        // Place the process of the message read...
        ...

        EmailReadNext(MySession, MyMessage)
        END
      • Example that is using the Email structure:
        EmailReadFirst(MySession)
        WHILE NOT Email.Out
                // Place the process of the message read...
                ...
                
                EmailReadNext(MySession)
        END
    • or with a loop such as:
      MyMessage is Email
      FOR EACH MyMessage OF MySession
              // Place the process of the message read...
              ...
      END
  3. Close the POP3 session with EmailCloseSession.
Remark: A POP3 session and an SMTP session can be simultaneously started by EmailStartSession.
WindowsLinux

Principle and specific features in WINDEV

Principle and specific features in WINDEV

Remark: You may have to establish a connection by modem before starting the SMTP or POP3 session.
WEBDEV - Server codeWindowsLinux

Principle and specific features in WEBDEV

Sending and receiving emails in a WEBDEV site
In a WEBDEV site, the emails are sent and received by the Application Server.
The sending can be performed by a local spooler in order not to slow down a WEBDEV site if the SMTP server takes time to respond. This function is managed automatically by the WEBDEV Application Server.
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