Help / WLanguage / WLanguage functions / Communication / Managing emails
  • POP3 and SMTP protocols
  • Authenticated SMTP
  • Timeout
  • Required application feature
  • Gmail: What to do if a connection to Gmail (SMTP, IMAP, POP3) fails with a certificate error?
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Starts a session for managing emails via the POP3 protocol.
Remark: To start a session for reading emails (via the POP3 protocol only), use EmailStartPOP3Session.
MyPop3Session is emailPOP3Session
// Start a session to send an email using the POP3 protocol
IF MyPop3Session.StartSession() = True THEN
UserName = MyPop3Session..Name
UserName = ""
Error("Unable to establish the connection")

Start a POP3 email session Hide the details

<Result> = <POP3 session>.OpenSession()
<Result>: Boolean
  • True if the session was started,
  • False otherwise. If an error occurs, the ErrorOccurred variable is set to True.
    To get more details on the error, use ErrorInfo with the errMessage constant.
<POP3 session>: emailPOP3Session variable
Name of the emailPOP3Session variable corresponding to the email session to handle.

POP3 and SMTP protocols

The different parameters passed to <emailPOP3Session variable>.StartSession 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 uses a direct connection to Internet (cable or ADSL): no specific operation is required.
  • The user uses a modem to connect to Internet: NetOpenRemoteAccess establishes the Internet connection.
By default, if only the IP address of POP3 server is specified, this address will be used by the email server that uses SMTP. The IP address of SMTP protocol must be specified only if the POP3 account and the SMTP account do not use the same computer.

Authenticated SMTP

The SMTP authentication cannot be performed by <emailPOP3Session variable>.StartSession. To start a POP3 session and an authenticated SMTP session at the same time, you must use both EmailStartPOP3Session and EmailStartSMTPSession.


The timeout can be set using EmailSetTimeOut.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
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 <emailPOP3Session variable>.StartSession:
// Activation de l'implémentation multiplateforme
EmailConfigure(emailParameterMode, 1)
Remark: 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.
Component: wd290com.dll
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help