Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Special cases
  • Members of the Email structure taken into account
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
EmailRunApp (Function)
In french: EmailLanceAppli
Starts the native application for sending emails found on the current computer:
  • Computer running Windows (using the MAPI client),
  • Mobile device: Android, iPhone, iPad, Universal Windows 10.
The content and recipients of the email message are initialized from the information specified in the WLanguage Email structure.
  • The application for sending emails found on the current computer must have been configured with a valid account for sending emails (SMTP).
  • The current directory can be modified according to the configuration of the application for sending emails.
WINDEV Remarks:
  • This function is based on the MAPI client installed on the computer ("Simple MAPI" is not sufficient). If the MAPI client is not found, the function searches for the default client among: Microsoft Outlook, Outlook Express, Eudora, IncrediMail, Netscape, Mozilla Thunderbird, Mozilla.
  • Both the application and the MAPI client must be in 32 bits or in 64 bits. Indeed, if client is a 64-bit application, it will only be seen by the applications compiled in 64 bits (similarly, if client is a 32-bit application, it will only be seen by the applications compiled in 32 bits).
// Send a message with attachment
Email.Recipient[1] = ""
Email.NbRecipient = 1
Email.Subject = "Subject of message"
Email.Message = "Text of the message"
// Photo.jpg is a file created by the application
Email.Attach[1] = SysDirExternalStorage(1, ssePublicDocument) + [fSep] + "photo.jpg"
Email.NbAttach = 1

Special cases

  • A non-fatal error is triggered if no application for sending emails is found on the current computer. To find out whether the application for sending emails failed to start, use the ErrorOccurred variable.
  • To reinitialize the Email structure, use EmailReset.
  • EmailRunApp is a non-blocking function. The code that follows the call to this function will continue to run as soon as the application for sending emails is started.
  • There is no way to find out whether the sending of the email was validated by the user.

Members of the Email structure taken into account

WINDEV Only the following members of the Email structure will be taken into account when initializing the message to send:
  • Email.Attach
  • Email.Cc
  • Email.Bcc
  • Email.Bcc
  • Email.Recipient
  • Email.Message
  • Email.NbAttach
  • Email.NbCc
  • Email.NbBcc 
  • Email.NbBcc
  • Email.NbRecipient
  • Email.Subject
Universal Windows 10 App The following members are taken into account:
  • Email.Attach
  • Email.Cc
  • Email.Bcc
  • Email.Recipient
  • Email.Message
  • Email.Subject
Related Examples:
WM Expense Account Cross-platform examples (WINDEV Mobile): WM Expense Account
[ + ] This example allows you to manage your fees.

Let's see the main features of this application:
- The input of invoices
- Management of foreign currencies
- Inclusion of photo document for the invoices
- Ability to email the expense account
- Ability to track the expense accounts
- ...
Component: wd290com.dll
Minimum version required
  • Version 16
This page is also available for…
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help