PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Example with an Email variable
  • Example with the Email structure
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
Generates the source code of the outgoing email from the variables currently found in the email structure or in an Email variable.
The source code is generated in the Variable Email.Source or in the Property ..Source of the Variable Email. 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

Example with an Email variable

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

Example with the Email structure

// Initialize the email structure
Email.NbRecipient = 1
Email.Recipient = "support_test@pcsoft_test.fr"
Email.Sender = "customer@company.fr"
Email.Message = "Auto Email Test"
 
// Create the .eml file
IF EmailBuildSource() = True THEN
fSaveText("c:\MyEmails\Test.eml", Email.Source)
END
Syntax
<Result> = EmailBuildSource([<Email> [, <Advanced options>]])
<Result>: Boolean
  • True if the source code was generated,
  • False otherwise. The ErrorOccurred variable is set to True if an error occurred.
    To find out the name of the error, use the function ErrorInfo with the constant errMessage. The generated code can be read in the Email.Source variable of current thread.
<Email>: Optional Email variable
Versions 15 and later
Name of the Email variable to use.
New in version 15
Name of the Email variable to use.
Name of the Email variable to use.
If this parameter is not specified, the email structure is used.
<Advanced options>: Optional Integer constant
Versions 22 and later
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.
Versions 22 and later
emailOptionHeaderBcc
New in version 22
emailOptionHeaderBcc
emailOptionHeaderBcc
Used to add the non-official recipients into the source code of email header.
New in version 22
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.
Versions 22 and later
emailOptionHeaderBcc
New in version 22
emailOptionHeaderBcc
emailOptionHeaderBcc
Used to add the non-official recipients into the source code of email header.
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.
Versions 22 and later
emailOptionHeaderBcc
New in version 22
emailOptionHeaderBcc
emailOptionHeaderBcc
Used to add the non-official recipients into the source code of email header.
Remarks
To fill the email structure or a variable of type Email from the contents of its ..Sourceproperty, use the EmailImportSource function.
Component: wd260com.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment