|
|
|
|
|
- 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: this e-mail reception protocol 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 IncomingData protocol 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.
- the SMTP protocol: this protocol is an e-mail protocol 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 mode of e-mail management is used by most Microsoft applications, principally the MS Exchange client.
- Lotus Notes or Outlook email software: these programs let you send and receive emails.
Remarks:  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.The principle is as follows: - 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
Related Examples:
|
Complete examples (WINDEV): WD Mail
[ + ] This application is an email client developed in WINDEV. It is based on the Email objects. This email client is used to retrieve and send emails by using the POP, IMAP and SMTP protocols. You have the ability to apply filters to the incoming emails. The application can also be used to manage several email accounts. The writing of an email is based on the HTML edit control.
|
|
Training (WINDEV): WD Mailshot
[ + ] This example explains how to send a mailshot with WINDEV. This example is used to type the subject of the message, its content and its attachments. Then, the user must select the customers to which the message will be sent. The WLanguge EmailSendMessage() function is used to send the message to each selected customer. Technical implementation: An email server compatible with POP3/SMTP must necessarily be accessible from the computer on which the application is run.
|
|
Unit examples (WINDEV): Sending emails
[ + ] Sending emails with WINDEV.
|
|
Unit examples (WINDEV): Sending an email in HTML format
[ + ] Using the WLanguage "EmailImportHTML" function. This function is used to import an HTML file into the email structure. This allows you to easily add images into the emails.
|
|
Unit examples (WINDEV): The POP3 Email functions
[ + ] Using the Email functions to manage the POP3 protocol. This protocol is used to retrieve emails from a server.
|
|
Training (WINDEV): WD JavaMail
[ + ] This example is a Java example used to read and send emails.
|
|
Complete examples (WINDEV): WD POP3Proxy
[ + ] This example presents a POP3 proxy. A proxy is a program that connects to a server on behalf of another program. A proxy can be used to isolate a local network from Internet for security reasons for example. Only the computer hosting the proxy is linked to Internet and the users access the email server via the proxy. In this example, the proxy is used to automatically archive the retrieved emails into a HFSQL database. Several additional features can be used in this application: automatic filtering of spams, statistics about the emails...
|
|
Complete examples (WEBDEV): WW_CMS
[ + ] This example is an example of CMS (Content Management System). This is a site for content management, typically a site for displaying some articles. This example is divided into 2 parts: - An AWP part for the part that must be referenced - A WEBDEV part for the management part Note: In order for some features of the example to operate (sending emails for example), the parameters must be modified in order to adapt them to your configuration. These parameters are stored as constants defined in the code of the project.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|