Home | Sign in | English EN
New WINDEV, WEBDEV and WINDEV Mobile 26 feature!
  • Asynchronous mode
  • Progress Bar
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Sends an email using Lotus Notes: the email is placed in the outbox of the messaging software. The email is automatically sent by the spooler of Domino.
Caution: Lotus Notes must be installed in connected mode (and not in local mode).
Caution: Before sending the email, you must:
// Start a Notes session
MySession is emailNotesSession
// Build an email
MyMessage is Email
MyMessage.Sender = "ordering_department@mycompany.fr"
MyMessage.Subject = EDT_EmailSubject
MyMessage.Message = "EDT_EmailText"
// Send the message
Reports and QueriesUser code (UMC)Ajax

Sending an email via MS Exchange, Pocket Outlook, Lotus Notes or Outlook Hide the details

<Result> = EmailSendMessage(<Session ID> [, <Email> [, <Display> [, <Type>]]])
<Result>: Boolean
  • True if the message was placed in the outbox of MS Exchange, Lotus Notes or Outlook,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Session ID>: emailNotesSession variable
Identifies the current email session. This parameter is an integer returned by EmailStartNotesSession.
<Email>: Optional Email variable
Versions 15 and later
Name of the Email variable corresponding to the email to send.
If this parameter is not specified, the information found in the Email structure is used.
New in version 15
Name of the Email variable corresponding to the email to send.
If this parameter is not specified, the information found in the Email structure is used.
Name of the Email variable corresponding to the email to send.
If this parameter is not specified, the information found in the Email structure is used.
<Display>: Optional boolean
  • True to display the message in a dialog box before sending it,
  • False (by default) to display no dialog box.
This parameter is taken into account only if the email session was started by <EmailNotesSession variable>.StartSession, by using the MS Exchange syntax with a profile name. In the other cases, the dialog box is not displayed.
Remark: This parameter is not available for Lotus Notes.
<Type>: Optional character string (with quotes)
Describes the type of message to send. By default, <Type> = "IPM" (Inter Personal Message).

Asynchronous mode

If the session was started in asynchronous mode (<EmailNotesSession variable>.StartSession and EmailStartSMTPSession), <emailNotesSession variable>.SendMessage creates an identifier for each email sent.
The email identifier is stored in the Email.MailIdentifier variable and can be used by EmailStatus to determine the current status of the outgoing email (sent, in progress, etc.).
Processing the errors in asynchronous mode: <emailNotesSession variable>.SendMessage returns True if the email is placed in the email spooler, False if the spooler cannot be contacted. To find out whether the email was sent, you must use EmailStatus.
Reports and QueriesUser code (UMC)

Progress Bar

To follow the sending progress, use EmailProgressBar.
Related Examples:
Sending an email in HTML format Unit examples (WINDEV): Sending an email in HTML format
[ + ] Using the WLanguage "EmailImportHTML" function.
This function is used to import an HTML file into the email structure. This allows you to easily add images into the emails.
Sending emails Unit examples (WINDEV): Sending emails
[ + ] Sending emails with WINDEV.
WD Mailshot Training (WINDEV): WD Mailshot
[ + ] This example explains how to send a mailshot with WINDEV.

This example is used to type the subject of the message, its content and its attachments.
Then, the user must select the customers to which the message will be sent.
The WLanguge EmailSendMessage() function is used to send the message to each selected customer.
Technical implementation:
An email server compatible with POP3/SMTP must necessarily be accessible from the computer on which the application is run.
WD JavaMail Training (WINDEV): WD JavaMail
[ + ] This example is a Java example used to read and send emails.
Pocket Managing Contacts Mobile (WINDEV Mobile): Pocket Managing Contacts
[ + ] This example presents the management of contacts in Pocket PC.
The following topics will be presented in this example:
1/ the loopers
2/ the use of queries
3/ sending SMSs
4/ sending emails
5/ the phone call.
WW_CMS Complete examples (WEBDEV): WW_CMS
[ + ] This example is an example of CMS (Content Management System).
This is a site for content management, typically a site for displaying some articles.

This example is divided into 2 parts:
- An AWP part for the part that must be referenced
- A WEBDEV part for the management part

In order for some features of the example to operate (sending emails for example), the parameters must be modified in order to adapt them to your configuration.
These parameters are stored as constants defined in the code of the project.
Component: wd260com.dll
Minimum version required
  • Version 26
This page is also available for…
Click [Add] to post a comment