Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Operating mode of images and attachments
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Imports the content of an HTML file into an Email variable in order to send it by email. The images found in the HTML file are automatically included in the Email variable.
The current Email variable is filled: the NbAttach, Attach[...] and HTML properties are initialized according to the HTML content.
Remark: The images integrated by encoding in the HTML file are processed.
Remark: The HTML content is supported in POP3/SMTP only: this function must be used only if the email is sent in SMTP.
MyEmail is Email
MyHTMLText is ANSI string
MyHTMLText = fLoadText("C:\Email\MyEmail.htm")
MyEmail.Recipient = ""
MyEmail.Subject = "Test"
<Email>.ImportHTML(<HTML content to send> , <Directory>)
<Email>: Email variable
Name of the Email variable corresponding to the email into which the HTML document will be imported.
<HTML content to send>: ANSI character string
Email content in HTML format.
<Directory>: Character string
Reference directory for the images (case of relative paths in the HTML content).

Operating mode of images and attachments

If <HTML content to send> refers to images:
  • these images are automatically attached to the email in the Email variable.
  • the HTML code of message is modified in order to reference the attachments.
Caution: The attachments are "added" to the email. For example, if the NbAttach property is set to 2 before the call to <Email variable>.ImportHTML and if the HTML content references an image, this image will be included in the Attach[3] property and NbAttach will be set to 3.
The additional attachments must be added before using <Email variable>.ImportHTML.
The order in which the attachments are sent is not necessarily respected when the email is received. The identifier of images is a unique identifier.Remark: When importing into an Email variable, the images integrated by encoding in the source HTML file are also processed.
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.
WD Mail Complete examples (WINDEV): WD Mail
[ + ] This application is an email client developed in WINDEV. It is based on the Email objects.
This email client is used to retrieve and send emails by using the POP, IMAP and SMTP protocols.
You have the ability to apply filters to the incoming emails.

The application can also be used to manage several email accounts. The writing of an email is based on the HTML edit control.
Component: wd280com.dll
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help