PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • POP3 protocol
  • Session and user name
  • Time-out
  • Required application feature
  • Gmail: What to do if a connection to Gmail (SMTP, IMAP, POP3) fails with a certificate error?
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
Starts a session for receiving and reading emails with the POP3 protocol. You will only be able to read the emails. You have the ability to start a POP3 session secured via SSL.
Note: To start a session for sending emails, use EmailStartSMTPSession.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Example
// Read an email via the POP3 protocol
IF EmailStartPOP3Session(USER, PASSWORD, "pop3.supplier.com") = True THEN
UserName = USER
ELSE
UserName = ""
Error("Unable to establish the connection")
END
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
// Connection to a POP3 server that requires an SSL connection (gMail for example)
// 995 is the standard port for this type of service
EmailStartPOP3Session(EDT_SESSION, EDT_PWD, EDT_POP, 995, optionSSL)

// Connection to a non-secured POP server
EmailStartPOP3Session(EDT_SESSION, EDT_PWD, EDT_POP, 110)
// 110 is the standard port for this type of service.
// It is also the default value of the function,
// Therefore we could also write
EmailStartPOP3Session(EDT_SESSION, EDT_PWD, EDT_POP)
Syntax
<Result> = EmailStartPOP3Session(<User Name> , <Password> , <Address of POP3 Server> [, <Number of POP3 Port> [, <Option>]])
<Result>: Boolean
  • True if the session was started,
  • False otherwise. The ErrorOccurred variable is set to True if an error occurred.
    To find out the error details, use ErrorInfo associated with the errMessage constant.
<User Name>: Character string (with quotes)
Identifies the user. This name is supplied by the service provider or by the network administrator. This name will be used to identify the email session in the different functions for email management.
<Password>: Character string (with quotes)
User password. This password is given by the service provider or by the network administrator.
<Address of POP3 Server>: Character string (with quotes)
IP address of email server (incoming protocol). This IP address is supplied by the service provider or by the network administrator. This IP address can have the following format:
  • IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
  • IP address containing the server name (pop3.freesbee.eu for example). This syntax is recommended.
  • IP address returned by NetIPAddress.
<Number of POP3 Port>: Optional integer
Identifies the port used for the POP3 protocol (110 by default).
<Option>: Optional Integer constant
Used to specify whether an SSL connection is required:
optionSSLSSL connection required (for a secure POP3 server).

Note: in most cases, the port used for a secure POP3 server is 995 (instead of 110, the default port value).
LinuxAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App Constant not available.
Windows MobileUniversal Windows 10 App Constant not available.
Remarks

POP3 protocol

  • The different parameters passed to EmailStartPOP3Session are supplied by the Internet Service Provider or by the network administrator. 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.
  • The POP3 protocol can only be used to read emails. A WLanguage error occurs if you try to send emails without starting an SMTP session (EmailStartSMTPSession).
    To start a POP3 session and an SMTP session at the same time, use EmailStartSession.
  • The incoming emails are the ones received when starting the session. All the emails received once the session is started are not accessible. To access the new incoming emails, the POP3 session must be closed and re-started.

Session and user name

Once a POP3 session was started, you have the ability to start an SMTP session (EmailStartSMTPSession) by using the same user name.

Time-out

The time-out can be configured by EmailSetTimeOut.
Versions 21 and later
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.
New in version 21
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.

Gmail: What to do if a connection to Gmail (SMTP, IMAP, POP3) fails with a certificate error?

Since August 2017, a new certificate was deployed by Google: Google Internet Authority G3. Unfortunately, the Windows API for checking certificates does not validate this certificate.
Therefore, starting a POP3, IMAP or SMTP session may fail with the error "The certificate string was not issued by a trusted authority".
To validate the certificate, all you have to do is modify the management mode of emails. The WLanguage EmailConfigure function allows you to change this mode and to no longer use the Windows API that locks this certificate. The following code must be added before starting the session via EmailStartPOP3Session:
// Enable the multi-platform implementation
EmailConfigure(emailParameterMode, 1)
Note: From version 23 Update 1, the call to EmailConfigure is not required anymore: WLanguage is automatically using the management mode of emails adapted to the session.
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.
WD JavaMail Training (WINDEV): WD JavaMail
[ + ] This example is a Java example used to create an applet.
This applet can then be used in an Internet page.
This applet enables you read and send emails.
In this project, a second configuration enables you to manage a "Standard" Java application (.jar).
To generate the Java applet and the "Standard" Java application, select "Workshop - Java - Generate the Java archive",
for each one of the two configurations of project.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Java wd230java.jar
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment