PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of emailAttach variables
  • Functions that handle an emailAttach variable
  • Limits
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
emailAttach (Type of variable)
In French: emailAttache (Type de variable)
The emailAttach type is used to handle an attachment. The characteristics of this attachment can be defined and modified by several WLanguage properties.
This type of variable is used by the Email variables.
Note: See Declaring a variable for more details.
Versions 17 and later
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
New in version 17
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
iPhone/iPad This type of variable is now available for the 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 the 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 the Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for the Android applications.
Example
// Attach an attachment to an email

myEmail is Email
...
myAttach is EmailAttach
sFile is string

// Select the file to attach
sFile = fSelect("", "", "Select the PDF document to attach...", ...
"PDF documents (*.PDF)" + TAB + "*.pdf", "*.pdf")

// Build the emailAttach variable
myAttach..Name = fExtractPath(sFile, fFile + fExtension)
myAttach..Content = fLoadText(sFile)
myAttach..ContentType = "application/pdf"
myAttach..ContentDescription = "A PDF document"

// Add the attachment
Add(myEmail..Attach, myAttach)
// Second method with EmailLoadAttachment

MyTempSourceEmailFile is string
MyTempSourceEmailFile = CompleteDir(fExeDir()) + "EmailSource.eml"
IF fFileExist(MyTempSourceEmailFile) THEN
fDelete(MyTempSourceEmailFile)
END
EmailReset(MyEmailSource)

// Build the email in an EML file (email source)
// LIST_Attachment contains the list of my attachments
Add(MyEmailSource..Recipient, EDT_Recipient)
FOR EACH ROW OF LIST_Attachment
EmailLoadAttachment (MyEmailSource, ...
LIST_Attachment..DisplayedValue)
END

MyEmailSource..Sender = "my_address@test.com"
MyEmailSource..Subject = "My subject"
MyEmailSource..Message = HTMLToText(EDT_EMAIL_HTML)
EmailImportHTML(MyEmailSource, EDT_EMAIL, CompleteDir(fExeDir()))
EmailBuildSource(MyEmailSource)
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.
Note: If the attachment is filled manually, don't forget to specify ..Name otherwise the image will not be transmitted in the email. Example:
oEmail..Attach[1]..Content = fLoadBuffer(fDataDir() +
 ["\"] + "Email\" + sCompanyLogo)
oEmail..Attach[1]..ContentType = "image/gif"
oEmail..Attach[1]..Name = "logo.gif"
IdentifierCharacter stringIdentifier of attached file included in an HTML message.
NameCharacter stringName of attached file.


Notes:
  • These properties can be used via one of the following syntaxes:
    • <Variable Name>..<Property Name>
    • <Variable Name>.<Property Name>
  • Versions 17 and later
    You have the ability to use non-Latins characters in the ..Name and ..ContentDescription properties.
    New in version 17
    You have the ability to use non-Latins characters in the ..Name and ..ContentDescription properties.
    You have the ability to use non-Latins 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).
AndroidAndroid Widget

Limits

This type of variable is available for the devices equipped with ARM processors. A fatal error occurs if this type of variable is used with devices not equipped with ARM processors (x86, mips, ...). This type of variable is available for the devices equipped with ARM processors or using an ARM emulation. Otherwise (and on the Samsung Galaxy Tab 3 tablet), a fatal error will occur.
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 required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment