|
|
|
|
|
- Overview
- Managing emails
- Two-factor authentication for emails
- Synchronous/Asynchronous mode (WEBDEV)
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:
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|