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.
  • Properties specific to the description of emailAttach variables
  • Functions that handle an emailAttach variable
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
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 the Email variables.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
Versions 17 and later
iPhone/iPad This type of variable is now available for iPhone and iPad applications.
New in version 17
iPhone/iPad This type of variable is now available for iPhone and iPad applications.
iPhone/iPad This type of variable is now available for iPhone and iPad applications.
Versions 21 and later
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
New in version 22
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
Example
// 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, fFileName + fExtension)
monAttache.Content = fLoadBuffer(sFichier)
monAttache.ContentType = "application/pdf"
monAttache.ContentDescription = "Un document PDF"
 
// 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
fDelete(MonFichierEmailSourceTemp)
END
EmailReset(MonSourceEmail)
 
// 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)
FOR EACH ROW OF LISTE_Attachement
EmailLoadAttachment(MonSourceEmail, ...
LISTE_Attachement.ValeurAffichée)
END
 
MonSourceEmail.Expediteur = "mon_adresse@test.com"
MonSourceEmail.Sujet = "Mon sujet"
MonSourceEmail.Message = HTMLToText(SAI_EMAIL_HTML)
EmailImportHTML(MonSourceEmail, SAI_EMAIL, CompleteDir(fExeDir()))
EmailBuildSource(MonSourceEmail)
Remarks

Properties specific to the description of 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.

Versions 17 and later
Remark: You can use non-Latin characters in the Name and ContentDescription properties.
New in version 17
Remark: You can use non-Latin characters in the Name and ContentDescription properties.
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:
Versions 15 and later
EmailLoadAttachment
New in version 15
EmailLoadAttachment
EmailLoadAttachment
Adds an attached file to an email.
Versions 09 and later
EmailSaveAttachment
New in version 09
EmailSaveAttachment
EmailSaveAttachment
Copies 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…
Comments
Click [Add] to post a comment