Export (0) Print
Expand All GetAttachment

The GetAttachment command retrieves an email attachment from the server.

Attachment data is not automatically included with email messages in a synchronization. Instead, an Attachment element ([MS-ASAIRS] section is included for each attachment. The Attachment element specifies the location of an item on the server to retrieve in the FileReference element ([MS-ASAIRS] section Attachments are explicitly retrieved by attachment file reference using the GetAttachment command.

This command is issued within the HTTP POST command, and does not require any additional information in an XML body. The name of the attachment to be retrieved is specified in the AttachmentName command parameter.

The content of the attachment is returned in the response body with the content type being specified in the Content-Type header of the response. When the Content-Type header is missing, this indicates that the default encoding of 7-bit ASCII has been used.

If the GetAttachment command is used to retrieve an attachment that has been deleted on the server, a 500 status code is returned in the HTTP POST response.

Protocol Versions

The following table specifies the protocol versions that support this command. The client indicates the protocol version being used by setting either the MS-ASProtocolVersion header, as specified in [MS-ASHTTP] section, or the Protocol version field, as specified in [MS-ASHTTP] section, in the request.

Protocol version

Command support









In protocol versions 14.0 and 14.1, an attachment is fetched via the Fetch element of the ItemOperations command, as specified in section In version 2.5 of the protocol, the email:Attachment element ([MS-ASEMAIL] section is used instead of the airsyncbase:Attachment element ([MS-ASAIRS] section element.

© 2014 Microsoft