PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Creating a profile
  • Time-out
  • Managing emails in asynchronous mode
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
Allows you to access the data handled by the Outlook messaging software (emails, contacts, groups of contacts, tasks, appointments and folders). This function is identical to OutlookStartSession.
Caution: This function cannot be used to access the data handled by the Outlook Express messaging software.
Note: When using EmailStartOutlookSession, the current directory is automatically modified by Outlook.
Example
// Start the session
IF EmailStartOutlookSession("MyProfile") <> 0 THEN
Info("Session started")
ELSE
ErrorInfo()
END
nOutlookSessionID is int
// Opens the Outlook session with the default profile
nOutlookSessionID = EmailStartOutlookSession("")
// Session started?
IF nOutlookSessionID = 0 THEN
// Failure starting the session
Error("Failure opening the Outlook session", ErrorInfo())
ELSE
// Process
Info("List of email folders of Outlook:", ...
EmailListFolder(nOutlookSessionID))
// Closes the session
EmailCloseSession(nOutlookSessionID)
END
Syntax

Starting the Outlook session Hide the details

<Result> = EmailStartOutlookSession(<Profile>)
<Result>: Integer
  • Session identifier.
  • 0 (or False) if an error occurred. The ErrorOccurred variable is set to True. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Profile>: Character string
Identifies the connection profile (see Notes).
If this parameter corresponds to an empty string (""):
  • if several profiles are defined on the current computer, EmailStartOutlookSession displays a window containing all profiles among which the user can choose his own profile.
  • if a single profile is defined on the current computer, EmailStartOutlookSession automatically selects this profile.
Windows Mobile User account to use. If this parameter contains an empty string (""), the "ActiveSync" user account will be used.
Versions 18 and later

Starting the Outlook session while specifying the management mode of contacts/participants Hide the details

<Result> = EmailStartOutlookSession(<Profile> , <Asynchronous> [, <Opening Options>])
<Result>: Integer
  • Session identifier.
  • 0 (or False) if an error occurred. The ErrorOccurred variable is set to True. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Profile>: Character string
Identifies the connection profile (see Notes).
If this parameter corresponds to an empty string (""):
  • if several profiles are defined on the current computer, EmailStartOutlookSession displays a window containing all profiles among which the user can choose his own profile.
  • if a single profile is defined on the current computer, EmailStartOutlookSession automatically selects this profile.
Windows Mobile User account to use. If this parameter contains an empty string (""), the "ActiveSync" user account will be used.
<Asynchronous>: Constant or boolean
Mode for sending the emails:
emailAsynchronous or TrueThe outgoing emails must be transmitted in asynchronous mode (see the Notes).
emailSynchronous or False
(Default value)
The outgoing emails must be transmitted in synchronous mode (see the Notes).
WINDEVWindows Mobile This parameter must correspond to emailSynchronous or False.
<Opening Options>: Optional integer constant
Mode for opening the Outlook session:
outlookAPTWithContact
(Default value)
The AppointmentXXX functions will list the contacts associated with the appointments in the mAppointment.Participant variable (see Appointment structure).
outlookAPTWithParticipantThe AppointmentXXX functions will list the participants associated with the appointments in the following variables:
  • mAppointment.Participant
  • mAppointment.ParticipantCc
  • mAppointment.ParticipantBcc
See Appointment structure for more details.
New in version 18

Starting the Outlook session while specifying the management mode of contacts/participants Hide the details

<Result> = EmailStartOutlookSession(<Profile> , <Asynchronous> [, <Opening Options>])
<Result>: Integer
  • Session identifier.
  • 0 (or False) if an error occurred. The ErrorOccurred variable is set to True. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Profile>: Character string
Identifies the connection profile (see Notes).
If this parameter corresponds to an empty string (""):
  • if several profiles are defined on the current computer, EmailStartOutlookSession displays a window containing all profiles among which the user can choose his own profile.
  • if a single profile is defined on the current computer, EmailStartOutlookSession automatically selects this profile.
Windows Mobile User account to use. If this parameter contains an empty string (""), the "ActiveSync" user account will be used.
<Asynchronous>: Constant or boolean
Mode for sending the emails:
emailAsynchronous or TrueThe outgoing emails must be transmitted in asynchronous mode (see the Notes).
emailSynchronous or False
(Default value)
The outgoing emails must be transmitted in synchronous mode (see the Notes).
WINDEVWindows Mobile This parameter must correspond to emailSynchronous or False.
<Opening Options>: Optional integer constant
Mode for opening the Outlook session:
outlookAPTWithContact
(Default value)
The AppointmentXXX functions will list the contacts associated with the appointments in the mAppointment.Participant variable (see Appointment structure).
outlookAPTWithParticipantThe AppointmentXXX functions will list the participants associated with the appointments in the following variables:
  • mAppointment.Participant
  • mAppointment.ParticipantCc
  • mAppointment.ParticipantBcc
See Appointment structure for more details.

Starting the Outlook session while specifying the management mode of contacts/participants Hide the details

<Result> = EmailStartOutlookSession(<Profile> , <Asynchronous> [, <Opening Options>])
<Result>: Integer
  • Session identifier.
  • 0 (or False) if an error occurred. The ErrorOccurred variable is set to True. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Profile>: Character string
Identifies the connection profile (see Notes).
If this parameter corresponds to an empty string (""):
  • if several profiles are defined on the current computer, EmailStartOutlookSession displays a window containing all profiles among which the user can choose his own profile.
  • if a single profile is defined on the current computer, EmailStartOutlookSession automatically selects this profile.
Windows Mobile User account to use. If this parameter contains an empty string (""), the "ActiveSync" user account will be used.
<Asynchronous>: Constant or boolean
Mode for sending the emails:
emailAsynchronous or TrueThe outgoing emails must be transmitted in asynchronous mode (see the Notes).
emailSynchronous or False
(Default value)
The outgoing emails must be transmitted in synchronous mode (see the Notes).
WINDEVWindows Mobile This parameter must correspond to emailSynchronous or False.
<Opening Options>: Optional integer constant
Mode for opening the Outlook session:
outlookAPTWithContact
(Default value)
The AppointmentXXX functions will list the contacts associated with the appointments in the mAppointment.Participant variable (see Appointment structure).
outlookAPTWithParticipantThe AppointmentXXX functions will list the participants associated with the appointments in the following variables:
  • mAppointment.Participant
  • mAppointment.ParticipantCc
  • mAppointment.ParticipantBcc
See Appointment structure for more details.
Remarks

Creating a profile

To start a new session with Outlook, a "profile" must be defined. This "profile" is defined in the configuration of the Internet connection with Outlook.
To create a profile:
  1. Start Outlook.
  2. In the "Choosing a profile" window, click [New].
  3. Select the "Microsoft Exchange Server" service.
  4. Give a name to the profile.
  5. Enter the name of Microsoft Exchange server.

Time-out

The time-out can be configured by EmailSetTimeOut.
WEBDEV - Server codeAjax

Managing emails in asynchronous mode

The email functions are locking functions by default. Which means that no other code can be run during their execution. The program will resume only when the current Email functions have been run.
WEBDEV gives you the ability to manage the emails in asynchronous mode. This mode allows your sites to send emails without locking the execution of other processes.
To use the asynchronous mode, you must:
  1. Uncheck "Disable the email spooler" in the WEBDEV administrator ("Advanced" tab).
  2. Enable the asynchronous mode when starting the SMTP session (with EmailStartSMTPSession or EmailStartSession).
  3. All the outgoing emails will be transmitted to a "spooler". The emails are queued up before they are sent.
The execution of Email functions do not lock the rest of your program anymore. EmailStatus is used to find out the email status.
Note: If the WEBDEV administrator is closed, the email spooler is cleared: the pending emails are not sent and they are removed form the spooler.
If "Disable the email spooler" is checked while emails are still found in the spooler, these emails will not be lost: the administrator keeps sending them but no new email is accepted by the spooler.
Caution: The asynchronous mode can only be used when starting a session on an SMTP server (EmailStartSMTPSession for sending emails or EmailStartSession). The asynchronous mode is ignored in all the other cases.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment