This content has been translated automatically.  Click here  to view the French version.
  • Properties specific to emailAttach variables
  • Functions that handle an emailAttach variable
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
The emailAttach type is used to handle an attachment. The characteristics of this attachment can be defined and modified using different WLanguage properties.
This type of variable is used by Email variables.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
// Attachement d'une pièce jointe à un email
monEmail is Email
monAttache is emailAttach
sFichier is string
// Sélection du fichier à joindre
sFichier = fSelect("", "", "Sélectionnez le document PDF à joindre...", ...
"Documents PDF (*.PDF)" + TAB + "*.pdf", "*.pdf")
// Construction de la variable emailAttache
monAttache.Name = fExtractPath(sFichier, fFile + fExtension)
monAttache.Content = fLoadBuffer(sFichier)
monAttache.ContentType = fContentType(sFichier)
monAttache.ContentDescription = "Un document"
// Ajout de la pièce jointe
Add(monEmail.Attach, monAttache)
// Seconde méthode avec EmailChargeFichierAttaché
MonFichierEmailSourceTemp is string
MonFichierEmailSourceTemp = CompleteDir(fExeDir()) + "EmailSource.eml"
IF fFileExist(MonFichierEmailSourceTemp) THEN
// Construction de l'email dans un fichier EML (source de l'email)
// LISTE_Attachement contient la liste de mes pièces jointes
Add(MonSourceEmail.Destinataire, SAI_Destinataire)
EmailLoadAttachment(MonSourceEmail, ...
MonSourceEmail.Expediteur = ""
MonSourceEmail.Sujet = "Mon sujet"
MonSourceEmail.Message = HTMLToText(SAI_EMAIL_HTML)
EmailImportHTML(MonSourceEmail, SAI_EMAIL, CompleteDir(fExeDir()))

Properties specific to emailAttach variables

The following properties can be used to handle an emailAttach variable:
Property nameType used Effect
ContentDescriptionCharacter stringText used to describe the attachment content.
ContentTypeCharacter stringType of file according to the MIME standard (Multipurpose Internet Mail Extensions). The "Content Type" indicates to the messaging software how the attachment must be interpreted.
ContentBufferContent of attachment.
Remark: If the file is attached manually, do not forget to specify the Name property, otherwise the image will not be sent along with the email. Example:
oEmail.Attache[1].Contenu = ...
fLoadBuffer(fDataDir() + ...
 ["\"] + "Email\" + sLogoSociété)
oEmail.Attache[1].ContentType = "image/gif"
oEmail.Attache[1].Nom = "logo.gif"
IdentifierCharacter stringIdentifier of attached file included in an HTML message.
NameCharacter stringName of attached file.

Remark: You can use non-Latin characters in the Name and ContentDescription properties.

Functions that handle an emailAttach variable

The following functions can be used to handle an emailAttach variable:
EmailLoadAttachmentAdds an attached file to an email.
EmailSaveAttachmentCopies the attachment of current email onto the user computer (locally).
Related Examples:
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.
Minimum version required
  • Version 15
This page is also available for…
Click [Add] to post a comment