PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example 1: Deleting the fifth email received via the POP3 protocol
  • Example 2: Deleting incoming emails via MS Exchange
  • Example 3: Deleting incoming emails via Pocket Outlook
EmailDeleteMessage (Example)
Example 1: Deleting the fifth email received via the POP3 protocol
The following code is used to read the fifth incoming email and to delete it. The characteristics of the POP3 protocol have been specified by EmailStartSession (address of the POP3 server, address of the SMTP server, etc.).
// Start the email session
IF EmailStartSession(USER, PASSWORD, "pop3.gmail.com", ...
"smtp.gmail.com") = True THEN
UserName = USER
ELSE
UserName = ""
Error("Unable to establish the connection")
END
// Read the incoming messages
I is int
nbMSG is int = EmailNbMessage(UserName)
FOR I = 1 TO nbMSG
EmailReadMessage(UserName, I)
IF I = 5 THEN
EmailDeleteMessage(UserName, 5)
END
END
 
Example 2: Deleting incoming emails via MS Exchange
WINDEVWEBDEV - Server codeReports and QueriesWindowsAjaxUser code (UMC) The following code is used to delete the emails received in MS Exchange. These emails are found in the in-box of MS Exchange and on the server. A profile ("PROFILE_Example") was created in MS Exchange. See EmailStartSession for more details.
EmailID is int
// Start the email session
EmailID = EmailStartSession("PROFILE_Example")
// Reads all the incoming messages and asks to delete some of them
EmailReadFirst(EmailID)
WHILE Email.Out = False
IF YesNo(Email.Subject + CR + "Do you want to delete this message?") THEN
EmailDeleteMessage(EmailID)
END
EmailReadNext(EmailID)
END
...
EmailCloseSession(EmailID)
 
Example 3: Deleting incoming emails via Pocket Outlook
Windows Mobile The following code is used to delete the emails received in Pocket Outlook. These emails are found in the inbox of Pocket Outlook and on the server. An account ("Example_Account") was created in Pocket Outlook. See Managing emails via CEMAPI: Other accounts for more details.
EmailID is int
// Start the email session
EmailID = EmailStartSession("Example_Account")
// Reads all the incoming messages and asks to delete some of them
EmailReadFirst(EmailID)
WHILE Email.Out = False
IF YesNo(Email.Subject + CR + "Do you want to delete this message?") THEN
EmailDeleteMessage(EmailID)
END
EmailReadNext(EmailID)
END
...
EmailCloseSession(EmailID)
 
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment