|
|
|
|
|
- Overview
- Managing emails
- Two-factor authentication for emails
Sending and receiving emails
WINDEV, WEBDEV and WINDEV Mobile allow you to directly manage the emails from your applications. Sending and receiving emails are simplified by: - multiple WLanguage functions,
- several advanced types used to easily handle several connections to servers and an important number of messages:
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:  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:
OAuthGoogleCnt is OAuth2Parameters
gMyIMAPSession is emailIMAPSession
gMyIMAPSession.ServerAddress = "imap.gmail.com"
gMyIMAPSession.Option = optionTLS
MyIMAPSession.Port = "993"
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"
gMyIMAPSession.AuthToken = AuthIdentify(OAuthGoogleCnt)
IF gMyIMAPSession.AuthToken <> Null THEN
IF EmailStartSession(gMyIMAPSession) THEN
ELSE
END
ELSE
END
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|