|
|
|
|
|
- Properties specific to emailAttach variables
- Functions that use an emailAttach variable
emailAttach (Variable type) In french: emailAttache
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.
// 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 = fLoadBuffer(sFile) myAttach.ContentType = fContentType(sFile) myAttach.ContentDescription="A 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 emailAttach variables The following properties can be used to handle emailAttach variables: | | | Property name | Type used | Effect |
---|
ContentDescription | Character string | Text used to describe the attachment content. | ContentType | Character string | Type 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. | Content | Buffer | Content 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.Attach[1].Content = ... fLoadBuffer(fDataDir() + ... Â ["\"] + "Email\" + sCompanyLogo) oEmail.Attach[1].ContentType = "image/gif" oEmail.Attach[1].Name = "logo.gif" | Identifier | Character string | Identifier of attached file included in an HTML message. | Name | Character string | Name of attached file. | Remark: You can use non-Latin characters in the Name and ContentDescription properties.Functions that use an emailAttach variable The following functions can be used to handle emailAttach variables:
Related Examples:
|
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.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|