ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Handling the messages and their attached files
  • Reminder
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Copies the attachment of current email onto the user computer (locally).
Example
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadUser code (UMC)Ajax
anEmail is Email
sFilePath is string = "mail_pdf.eml"
anAttachment is emailAttach

anEmail.Source = fLoadBuffer(sFilePath)

IF anEmail.ImportSource() THEN
    sExtractedFile is string = "test.pdf"
    anAttachment = anEmail.Attach[1]
    anAttachment.SaveAttachment(sFichierExtrait)
END
Syntax
<Result> = <Attached file>.SaveAttachment(<Name of copied file>)
<Result>: Boolean
  • True if the attached file was copied onto the local computer.
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Attached file>: emailAttach variable
Name of the emailAttach variable containing the description of attached file.
<Name of copied file>: Character string
Name and full or relative path of file copied onto the local computer.
Remarks

Handling the messages and their attached files

We recommend that you save the messages and their attached files on the local drive (or on a server drive), then delete them from the server. This operation is used to:
  • reduce the size of the mailbox on the server,
  • improve and streamline data exchange by only reading new messages on the server.

Reminder

Email variable: The files attached to the current message are returned by the Email.Attach property (an array containing the names of the files attached to the current message).
Component: wd300com.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/27/2025

Send a report | Local help