AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Gestión de correos electrónicos
  • Overview
  • Managing emails
  • Two-factor authentication for emails
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to directly manage the emails from your applications. Sending and receiving emails are simplified by:
Note: It is also possible to manipulate the content of emails without sending them (functions EmailBuildSource and EmailImportSource).
Managing emails
Several methods can be used to manage emails:
  • Via the POP3, IMAP and SMTP protocols:
    • POP3 protocol protocol: this protocol for receiving Email is recognized by all service providers. This protocol allows you to directly communicate with the server, available at your ISP. This protocol is used to list and read incoming messages.
    • IMAP protocol protocol: this protocol for receiving Email allows emails to be left on the server so that they can be consulted from different e-mail clients or webmail. Several characteristics associated with the emails can be managed.
    • SMTP protocol protocol: this is a protocol for sending emails recognized by all service providers.
  • Via Lotus Notes, Outloook or MS Exchange:
    • the "Simple Mail API (also known as SMAPI or Simple MAPI)" API This email management mode is used by most Microsoft applications, especially the MS Exchange client.
    • Lotus Notes or Outlook These programs let you send and receive emails.
Remarks:
  • LinuxJava Only the POP3 and SMTP protocols are available.
Two-factor authentication for emails
More and more providers offer secure email accounts (SMTP/IMAP) with two-factor authentication.
Here's how it works:
  • OAuth connection to the mailbox provider: this connection provides a token.
  • Use the token to connect to IMAP or SMTP email boxes.
Let's see an example of code that can be used:
// Example of IMAP connection with a Gmail account
// and two-factor authentication
OAuthGoogleCnt is OAuth2Parameters
gMyIMAPSession is emailIMAPSession

// IMAP server parameters
gMyIMAPSession.ServerAddress = "imap.gmail.com"
gMyIMAPSession.Option = optionTLS
MyIMAPSession.Port = "993"

// OAuth connection parameters
OAuthGoogleCnt.ClientID = "Application ID"
OAuthGoogleCnt.ClientSecret = "Secret application ID"
OAuthGoogleCnt.AuthURL = "https://accounts.google.com/o/oauth2/auth"
OAuthGoogleCnt.TokenURL = "https://accounts.google.com/o/oauth2/token"
OAuthGoogleCnt.Scope = "https://mail.google.com/"
OAuthGoogleCnt.RedirectionURL = "http://localhost:9000"
OAuthGoogleCnt.ResponseType = "code"

// OAuth authentication
gMyIMAPSession.AuthToken = AuthIdentify(OAuthGoogleCnt)
// If the authentication was successful, log in to email inbox.
IF gMyIMAPSession.AuthToken <> Null THEN
	IF EmailStartSession(gMyIMAPSession) THEN
	// Session started
	ELSE
	// Error starting the session.
	END
ELSE
	// Authentication error.
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local