PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Retrieving messages
  • Memory consumption
  • Managing the progress bar
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Retrieves all the emails found on an email server.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Example
// Retrieve all unread emails from the in-box.
IMAPSession is emailIMAPSession
arrUnreadEmails is array of Emails

// Start the session
EmailStartSession(IMAPSession)

// Retrieve all unread emails
arrUnreadEmails = EmailGetAll(IMAPSession, ertNotRead)

// Display the information for each email
FOR EACH MyEmail OF arrUnreadEmails
LooperAddLine(LOOP_EMAIL, MyEmail..Sender, ...
MyEmail..Message, MyEmail..Subject)
END
Syntax
<Result> = EmailGetAll(<Connection> [, <Read Options>])
<Result>: Array of Email variables
Emails found in the in-box (the elements effectively retrieved depend on the parameters).
<Connection>: Character string or emailXXSession variable
Connection to the messaging server.
This parameter can be:
<Read Options>: Optional Integer constant
The possible values are:
ertAsynchronousThe messages are retrieved in asynchronous mode. The function immediately returns an array of Email variables containing as many elements as necessary. The effective retrieval of data is performed "upon request" when accessing the array elements.
Note: In this mode, the progress bars and the callbacks defined by EmailProgressBar are ignored.
ertFullThe messages are entirely read from the server (header, message body and attachments).
ertHeader
(default value)
Only the headers are read. The effective retrieval of other data (message body and attachments) is performed "upon request" when accessing the array elements.
ertNotReadOnly the messages flagged as "not read" on the server are retrieved.
Note: This value is not available for a POP3. connection.
Remarks

Retrieving messages

To retrieve all messages as well as their attachments, we recommend that you use the ertFull constant to reduce the number of calls to the server.
On the contrary, if you want to entirely retrieve some emails only, we recommend that you use the ertHeader constant (the default value) and let the automatic retrieval of message body be performed when it is required only (which means during the access to the ..Message property of Email variable).
Notes:
  • If a property of an email is modified before the message body or the attachments are retrieved, the retrieval of the message body and attachments is canceled.
  • Retrieving Outlook emails: ..ContentType is not available and ..ContentID is filled optionally.

Memory consumption

The retrieval of emails is performed in memory. If the in-box contains several messages or large attachments, the reading can consume a lot of memory.
WINDEVAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App

Managing the progress bar

To find out the progress status of retrieval, a progress bar or a procedure must be implemented by EmailProgressBar.
Two procedure syntaxes are supported:
  • Procedure receiving two parameters: the total size and the current progress.
  • Procedure receiving four parameters: the total size, the current progress, the subscript of the message currently processed and the total number of messages.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment