ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Timeout
  • Gmail: What should I do if a connection to Gmail (SMTP, IMAP, POP3) fails due to a certificate error?
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Starts a session for managing emails via the IMAP protocol.
Example
// Ouverture d'une session d'emails gérés par le protocole IMAP 
MaSessionIMAP is emailIMAPSession

IF MaSessionIMAP.StartSession() = True THEN
	NomUser = MaSessionIMAP.Name
ELSE
	NomUser = ""
	Error("Impossible d'établir la connexion")
END
Syntax
<Result> = <IMAP 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.
<IMAP session>: emailIMAPSession variable
Name of the emailIMAPSession variable corresponding to the email session to handle.
Remarks

Timeout

The timeout can be set using EmailSetTimeOut.

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

Since the end of August 2017, Google has deployed a new certificate: 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 <emailIMAPSession variable>.StartSession:
// Activation de l'implémentation multiplateforme
EmailConfigure(emailParameterMode, 1)
Remarks:
  • As of version 23 Update 1, you no longer need to call the EmailConfigure function: WLanguage automatically uses the email management mode appropriate to the session.
  • You can handle certificate errors on an SMTP session using the IgnoreError property of a variable of type emailSMTPSession.
Component: wd300com.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/20/2025

Send a report | Local help