PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

  • Example 1: Reading the first incoming email via the POP3 protocol
  • Example 2: Reading the first incoming email via MS Exchange
  • Example 3: Reading the first incoming email via Pocket Outlook
EmailReadFirst (Example)
Example 1: Reading the first incoming email via the POP3 protocol
The following code is used to read the incoming emails found in the mailbox of the POP3 protocol. These emails are read from the first one to the last one and they are displayed in the "TABLE_Email_Table" table. 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.ifrance.fr", ...
"smtp.ifrance.fr") = True THEN
UserName = USER
ELSE
UserName = ""
Error("Unable to establish the connection")
END
 
// Fill a table with the incoming messages
EmailReadFirst(UserName)
WHILE Email.Out = False
TableAdd(TABLE_Email_Table, Email.Sender + TAB + Email.Subject)
EmailReadNext(UserName)
END
 
Example 2: Reading the first incoming email via MS Exchange
WINDEVWEBDEV - Server codeReports and QueriesWindowsAjaxUser code (UMC) The following code is using MS Exchange to read the new incoming emails. These emails are found in the in-box of MS Exchange. 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")
// Retrieve the messages
// in the in-box of MS Exchange
EmailUpdate(EmailID)
// Browse the new incoming messages
// from the first one to the last one
EmailReadFirst(EmailID, "NOT READ")
WHILE Email.Out = False
IF YesNo("You have received an email from" + Email.Sender + ...
"Do you want to read it?") THEN
// Open the window for reading messages
Open(WIN_Email_RCV)
ELSE
EmailReadNext(EmailID, "NOT READ")
END
END
...
EmailCloseSession(EmailID)
 
Example 3: Reading the first incoming email via Pocket Outlook
Windows Mobile The following code is using Pocket Outlook to read the new incoming emails. These emails are found in the in-box of Pocket Outlook. 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")
// Browse the new incoming messages
// from the first one to the last one
EmailReadFirst(EmailID, "NOT READ")
WHILE Email.Out = False
IF YesNo("You have received an email from" + Email.Sender + ...
"Do you want to read it?") THEN
// Open the window for reading messages
Open(WIN_Email_RCV)
ELSE
EmailReadNext(EmailID, "NOT READ")
END
END
...
EmailCloseSession(EmailID)
 
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment