Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Example with an Email variable
  • Example with the Email structure
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Generates the source code of the email message to be sent from the variables in the Email structure or in a variable of type Email.
The source code is generated in the Email.Source variable or in the Source property of the Email variable. Then, this source code can be saved in a .eml file for example.
Remark: This function is useful to modify an element found in an outgoing email. The email can be sent by EmailSend. For more details, see Writing a custom email.

Example with an Email variable

// Initialize the variable
MyMessage is Email
Add(MyMessage.Recipient, "support_test@pcsoft_testfr")
MyMessage.Sender = ""
MyMessage.Message = "Auto Email Test"
// Create the .eml file
IF EmailBuildSource(MyMessage) = True THEN
fSaveText("c:\MyEmails\Test.eml", MyMessage.Source)

Example with the Email structure

// Initialize the email structure
Email.NbRecipient = 1
Email.Recipient = ""
Email.Sender = ""
Email.Message = "Auto Email Test"
// Create the .eml file
IF EmailBuildSource() = True THEN
fSaveText("c:\MyEmails\Test.eml", Email.Source)
<Result> = EmailBuildSource([<Email> [, <Advanced options>]])
<Result>: Boolean
  • True if the source code was generated,
  • False otherwise. If an error occurs, the ErrorOccurred variable is set to True.
    To get more details on the error, use ErrorInfo with the errMessage constant. The generated code can be read in the Email.Source variable of current thread.
<Email>: Optional Email variable
Name of the Email variable to be used.
If this parameter is not specified, the Email structure is used.
<Advanced options>: Optional Integer constant
Combination of following constants:
emailOptionEncodeHeaderEncodes the message headers in Quoted-Printable if necessary.
The message header is not encoded by default. This constant prevents the emails with wrongly encoded accented characters.
emailOptionHeaderBccUsed to add the non-official recipients into the source code of email header.
To populate the Email structure or a variable of type Email using the contents of its Source property, use EmailImportSource.
Component: wd290com.dll
Minimum version required
  • Version 12
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help