PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Principle
  • Step 1: Describing a user account in the application for email management on the PC
  • Create an account
  • Step 2: Configuring the synchronization of emails with ActiveSync
  • Configuring the synchronization of emails with ActiveSync
  • Step 3: Starting an email session
  • Example
  • Step 4: Sending and receiving emails
  • Sending emails
  • Receiving emails
  • Step 5: Closing the email session
  • Example
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
Principle
To send or read emails via the "ActiveSync" account of Pocket Outlook, you must:
  1. On the PC, describe a user account in the application for email management (Outlook or Outlook Express for example).
  2. On the PC, configure the synchronization of emails with ActiveSync.
  3. From the WINDEV Mobile application, connect to the application for email management (Pocket Outlook for example) by using EmailStartSession associated with a emailOutlookSession variable (or with EmailStartOutlookSession).
  4. Send and receive messages.
  5. Close the session to the application for email management (Pocket Outlook for example) with EmailCloseSession.
The emails will be automatically synchronized when the Pocket PC is connected to the PC.
Step 1: Describing a user account in the application for email management on the PC
The user account is used to configure the application for email management on the PC (Outlook or Outlook Express for example).
The following elements are defined in the user account:
  • the parameters of SMTP protocol used to send messages,
  • the parameters of POP3 or IMAP protocol used to receive messages,
  • the different communication services used.

Create an account

To create an account (in Outlook for example):
  1. Start Outlook.
  2. Select "Tools .. Accounts".
  3. Click "Add", then "Email".
  4. Answer the questions.
Step 2: Configuring the synchronization of emails with ActiveSync
ActiveSync is used to synchronize the emails found on the PC (in Outlook or Outlook Express for example) with the emails found on the Pocket PC (in Pocket Outlook for example).

Configuring the synchronization of emails with ActiveSync

To configure the synchronization of emails with ActiveSync:
  1. Start ActiveSync.
  2. Click the "Option" icon.
  3. Check "Inbox" in the list of elements to synchronize and validate.
Step 3: Starting an email session
Starting an email session can be performed by:
Note: This function must be called before any other "email" function in your application.

Example

Starting a session with an emailOutlookSession variable
PROCEDURE StartSession (AccountName)

MySession is EmailOutlookSession
MySession..Name = AccountName

EmailStartSession(MySession)
IF ErrorOccurred = True THEN
"The session cannot be started. Error:" + CR + ...
ErrorInfo(errMessage)

END

RESULT MySession
Starting a session with OutlookStartSession
PROCEDURE StartSession (AccountName)

SessionNum is int
SessionNum = OutlookStartSession(AccountName)

IF SessionNum = 0 THEN
Error("The session cannot be started. Error:" + CR + ...
ErrorInfo(errMessage))
END

RESULT SessionNum
Step 4: Sending and receiving emails

Sending emails

The emails are automatically sent as soon as the Pocket PC is connected to a PC equipped with an Internet access.
For more details, see: Preparing to send an email.

Receiving emails

The emails are automatically received when the Pocket PC is connected to a PC equipped with an Internet access.
For more details, see: Reading an email.
Step 5: Closing the email session
When the management of incoming and/or outgoing emails is completed, the session is closed by EmailCloseSession. This function must be the last "email" function used.

Example

The following code is a procedure used to close an email session. In this code, the SessionNum variable corresponds to the session identifier returned by EmailStartSession.
PROCEDURE CloseSession(SessionNum)
// Close the session
EmailCloseSession(SessionNum)
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment