PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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 WINDEV Mobile
  • Principle and specific features in WEBDEV
  • Notes
  • Connection to the service provider
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.
Notes:
  • The reception of emails can also be taken into account by using the IMAP protocol.
  • WINDEVWEBDEV - Server codeWindows The SSL connections are supported. WINDEVWEBDEV - Server codeWindowsLinuxAndroidAndroid Widget iPhone/iPad The SSL connections are supported.
Versions 17 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is now available for the iPhone/iPad applications.
iPhone/iPad This feature is now available for the 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 the Android applications.
New in version 22
Android Widget This feature is now available in Android Widget mode.
Android This feature is now available for the Android applications.
Android Widget This feature is now available in Android Widget mode.
Android This feature is now available for the 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:
    // 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:
    • with 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.
Note: A POP3 session and an SMTP session can be simultaneously started by EmailStartSession.
WINDEVWindowsLinuxJavaUser code (UMC)

Principle and specific features in WINDEV

You may have to establish a connection by modem before starting the SMTP or POP3 session.
Windows Mobile

Principle and specific features in WINDEV Mobile

If the mobile device is not equipped with an Ethernet card or a GPRS modem, the mobile device must be connected to a PC in order to manage the emails.
This connection allows the mobile device to share the Internet connection of the PC.
No specific setting is required in ActiveSync.
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 automatically managed by WEBDEV Application Server.
Notes
WINDEVWINDEV Mobile

Connection to the service provider

WINDEV An Internet connection is required to manage the emails. Several cases may occur:
  • The user is using a modem to connect to Internet: NetOpenRemoteAccess is used to establish the connection to Internet.
  • The user is using a direct connection to Internet (cable or ADSL): no specific operation is required.
WINDEV Mobile No specific operation is required to connect to the service provider.
Note: To limit the connection time:
  • When reading the emails, we advise you to read all the incoming emails and to save them in a HFSQL database for example.
  • When sending the emails, we advise you to prepare the emails beforehand.
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 required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment