ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Deleted messages (POP3 protocol)
  • Deleted messages (Outlook messaging)
  • Deleted messages (IMAP protocol)
  • New messages (POP3 protocol)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the number of incoming messages currently found:
  • on the email server (POP3 and IMAP protocol).
    • POP3 protocol: This number of messages remains constant throughout the email session, even if new emails are received or if emails are deleted with the EmailDeleteMessage function.
    • IMAP protocol: This number of messages changes according to the e-mails received or actually deleted from the e-mail server (via an "expunge" command, for example, emptying the recycle garbage can from a WebMail).. You also have the ability to force the destruction of all deleted emails via EmailExpunge.
  • WINDEV in the Outlook messaging software. This number of messages evolves according to the emails received or deleted by EmailDeleteMessage.
  • WINDEV in the Notes messaging software. This number of messages evolves according to the emails received or deleted by EmailDeleteMessage.
// Boucle de lecture de tous les messages reçus présents
// dans la boîte aux lettres du protocole POP3
I is int
nbMSG is int = EmailNbMessage(NomUser)
FOR I = 1 TO nbMSG
	EmailReadMessage(NomUser,I)
	IF Email.Out <> True THEN
		CL.NOM = Email.Sender
		CL.MESSAGE_TXT = Email.Message
		...
	ELSE
		Info("Ce message a été supprimé")
	END
END
Syntax

Finding out the number of emails found on the email server (POP3 protocol) Hide the details

<Result> = EmailNbMessage(<POP3 session>)
<Result>: Integer
  • Number of messages received on the server at the beginning of current email session,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo.
<POP3 session>: Character string
Identifies the user session (POP3). This parameter can correspond to:
WINDEVUser code (UMC)

Finding out the number of emails found in the Outlook messaging software Hide the details

<Result> = EmailNbMessage(<Outlook messaging session>)
<Result>: Integer
  • Number of incoming messages found in the Outlook messaging software during the call to EmailNbMessage,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo.
<Outlook messaging session>: Integer or emailOutlookSession variable
Identifier of the current email Outlook session . This parameter can correspond to:
WINDEVUser code (UMC)

Finding out the number of emails found on the Notes messaging software Hide the details

<Result> = EmailNbMessage(<Notes messaging session>)
<Result>: Integer
  • Number of incoming messages found in the Notes messaging software during the call to EmailNbMessage,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo.
<Notes messaging session>: emailNotesSession variable
Identifier of the current email Notes session .

Finding out the number of emails found on the email server (IMAP protocol) Hide the details

<Result> = EmailNbMessage(<IMAP messaging session>)
<Result>: Integer
  • Number of messages received on the server in the current email session,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo.
<IMAP messaging session>: emailIMAPSession variable
Identifier of the current email session (IMAP). This identifier is returned by EmailStartSession.
Remarks

Deleted messages (POP3 protocol)

If a message was deleted by EmailDeleteMessage:
  • EmailNbMessage returns the number of messages on the email server before they are deleted.
  • the message numbers are not re-assigned.
Therefore, if four messages are found on the server at the beginning of session, these messages are numbered from 1 to 4. If message #1 is deleted:
  • EmailNbMessage used in the same session always returns 4.
  • Message 1 cannot be read by EmailReadMessage because the message does not exist anymore (only messages 2, 3 and 4 exist).
The message numbers are re-assigned during the next connection.
WINDEVUser code (UMC)

Deleted messages (Outlook messaging)

If a message was deleted by EmailDeleteMessage in the same email session, EmailNbMessage returns the actual number of messages in the inbox folder.

Deleted messages (IMAP protocol)

If a message was deleted by EmailDeleteMessage, this message is actually deleted from the session:
  • during the next "expunge" command (clear the bin from a WebMail for example).
  • when using EmailExpunge to force all the deleted emails to be destroyed.

New messages (POP3 protocol)

The POP3 protocol cannot be used to find out and manage the new messages received during the connection. To get the new messages, you must disconnect (EmailCloseSession) and reconnect (EmailStartSession).
Component: wd300com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help