ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Properties specific to emailIMAPSession variables
  • Functions that use emailIMAPSession variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The emailIMAPSession type is used to access a messaging server by using the IMAP protocol (Internet Access Message Protocol) in order to retrieve the messages found on this server. You can define and change the characteristics of the connection using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Start the session
MySession is emailIMAPSession
MySession.ServerAddress = "imap.mycompany.us"
MySession.Name = "user"
MySession.Password = EDT_Password
EmailStartSession(MySession)

FOR EACH EmailMessage NOT READ OF MySession
Trace(EmailMessage.Subject)
END
Remarks

Properties specific to emailIMAPSession variables

The following properties can be used to handle emailIMAPSession variables:
Property nameType usedEffect
AuthTokenAuthToken variableEmail server access token to be used when if the OAuth 2.0 protocol is used (two-factor authentication). This access token is retrieved by AuthIdentify.
LinuxUniversal Windows 10 App This property is not available.
AndroidAndroid Widget This property is now available.
Name Character stringIdentifies the user. This name is supplied by the service provider or by the network administrator.
OptionInteger constantThe possible values are:
  • emailOptionDefault (default value): Connection using IMAP.
  • optionTLS: Connection using IMAP with TLS tunneling. This option guarantees confidentiality, but must be supported by the server.
    Before version 28 Update 4, this constant was named optionSSL .
Universal Windows 10 App This property is not supported.
PasswordCharacter stringUser password. This password is given by the service provider or by the network administrator.
PortIntegerIdentifies the port used for the IMAP protocol.
This property is set to 143 by default (standard port number of the IMAP protocol).
ServerAddressCharacter stringAddress of email server. This address is supplied by the service provider or by the network administrator. This address can be given in the following format:
  • IP address (in XXX.XXX.XXX.XXX format, 125.5.110.100 for example).
  • Name of server (for example, imap.free.fr). This syntax is recommended.

Functions that use emailIMAPSession variables

EmailAddFolderAdds a folder into the messaging software (Outlook, messaging software using the IMAP protocol (Internet Message Access Protocol), ...).
EmailChangeFolderModifies the current folder in the messaging software (Outlook, messaging software using the IMAP protocol, ...).
EmailChangeStatusChanges the status of an email on a messaging server.
EmailCloseSessionCloses an email management session depending on the selected mode (SMTP/POP3, IMAP, MS Exchange or Lotus Notes).
EmailCopyCopies an email found in a directory to another directory of an IMAP server.
EmailCurrentFolderReturns the name of current folder in the messaging software (Outlook, messaging software using the IMAP protocol (Internet Message Access Protocol), ...).
EmailDeleteMessageDeletes the current email using the current protocol (POP3, IMAP, MS Exchange, Lotus Notes or Outlook).
EmailExpungeDestroys all the deleted emails marked as deleted ("Deleted" status) from the current folder of IMAP session.
EmailGetAllRetrieves all the emails found on a server.
EmailGetIndicatorRetrieves the indicators defined on an email of IMAP session.
EmailListFolderReturns the list of folders:
  • found in the Outlook messaging software.
  • for an IMAP session.
EmailMessageLengthCalculates the size of specified message (without loading the message).
EmailNbMessageReturns the number of incoming messages currently found:
  • on the email server (POP3 protocol only).
  • in the Outlook messaging software.
EmailReadFirstReads the first incoming email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook).
EmailReadFirstHeaderReads the header of the first incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailReadLastReads the last incoming email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook).
EmailReadLastHeaderReads the header of last incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailReadMessageReads an incoming according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailReadMessageHeaderReads the header of an incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailReadNextReads the incoming email found after the current email according to the protocol (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook).
EmailReadNextHeaderReads the header of the email found after the current email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailReadPreviousReads the email found before the current email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook).
EmailReadPreviousHeaderReads the header of the email found before the current email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook).
EmailRemoveFolderDeletes a folder from the Outlook messaging software or from an IMAP server.
EmailSeekFirstFinds one or more emails according to the criteria specified in the messaging software (Outlook, messaging software using the IMAP protocol, ...).
EmailStartSessionStarts an email management session based on the selected management mode (POP3, SMTP, IMAP or MS Exchange).
Related Examples:
WD Mail 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.
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/21/2024

Send a report | Local help