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
  • Synchronous/Asynchronous mode (WEBDEV)
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:
  • WEBDEV - Código Navegador WEBDEV also allows you to use the messaging software of the Web user. This method simplifies the sending of emails from a WEBDEV website. Indeed, a single function (EmailOpenMail) is required to open this software on the computer of the Web user and to fill the email information.
  • LinuxJava Only the POP3 and SMTP protocols are available.
  • AndroidWidget Android The management via Lotus Notes, Outlook or MS Exchange is not 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
WEBDEV - Código Servidor
Synchronous/Asynchronous mode (WEBDEV)
By default, Email functions block execution (in Windows and Linux). Which means that no other code can be run during their execution. The program will resume only when the current Email functions have been run.
WEBDEV gives you the ability you to manage the emails in asynchronous mode. This mode allows your sites to send emails without locking the other processes.
To use the asynchronous mode, you must:
  1. Uncheck "Disable the email spooler" in the WEBDEV administrator ("Configuration" tab).
  2. Enable the asynchronous mode when starting the SMTP session (with EmailStartSMTPSession or EmailStartSession).
  3. All outgoing emails will be transmitted to a "spooler". Emails are queued up before being sent.
Executing Email functions does no longer block the rest of the program. EmailStatus is used to determine the status of an email.
Note: If the WEBDEV administrator is closed, the email spooler is cleared. Pending emails are not sent and are removed from the spooler.
If "Disable the email spooler" is checked while emails are still found in the spooler, these emails will not be lost: the administrator keeps sending them but no new email is accepted by the spooler.
Caution: Asynchronous mode can only be used when starting a session on an SMTP server (EmailStartSMTPSession function to send emails, or EmailStartSession). The asynchronous mode is ignored in all other cases.
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