ODBC Driver for Microsoft Exchange

Build 25.0.9434

DownloadAttachments

Downloads one or more attachments from an email message, allowing downstream processing or archival of the retrieved files.

Input

Name Type Required Description
AttachmentSource String True Specifies the source object from which to retrieve the attachment. Allowed values are 'Message' for emails or 'Event' for calendar items.
SourceId String True The unique identifier of the source email or calendar event containing the attachment(s) to be downloaded.
AttachmentId String False The unique identifier of a specific attachment to be downloaded. If omitted, all attachments from the source item will be downloaded. Not required if 'DownloadInEmlFormat' is specified.
DownloadTo String False The file system path where the attachment(s) should be saved. If not provided, the attachment content is returned as binary in the output.
UserId String False The identifier of the impersonated user under whose authority the operation is executed. Used in delegated access scenarios.
DownloadInEmlFormat String False Indicates whether the attachment should be downloaded in .eml format, which includes MIME headers and original message formatting.

The default value is false.

Encoding String False Specifies the character encoding type used for decoding the content bytes (for example, UTF-8 or Base64).

The allowed values are NONE, BASE64.

The default value is BASE64.

Result Set Columns

Name Type Description
Id String The unique identifier of the attachment that was successfully downloaded.
Name String The name or filename of the downloaded attachment, as it will appear when saved or viewed by the user.
ContentBytes String The raw content of the downloaded attachment, typically returned as a Base64-encoded binary string if not saved to disk.
LastmodifiedDatetime String The date and time when the attachment was last modified. Useful for version tracking and synchronization.
ContentType String The MIME content type of the attachment (for example, application/pdf, image/png). This field is null if 'DownloadTo' is specified.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434