AddAttachments
Attaches one or more files to an existing email message, allowing for automated message composition and delivery workflows involving document attachments.
Input
| Name | Type | Required | Accepts Input Streams | Description |
| Id | String | True | False | The unique identifier of the target item (message or event) to which the attachment will be added. Required to associate the attachment with the correct object. |
| DestinationType | String | True | False | Specifies the type of destination object to receive the attachment. Valid values are 'Message' for emails and 'Event' for calendar events. |
| FileName | String | True | False | The name that will be assigned to the attachment when it is added. This name will be displayed to recipients or users viewing the item. |
| LocalFile | String | False | False | The local file path containing the attachment content to upload. Used when reading the file directly from disk. |
| ContentBytes | String | False | False | The binary content of the attachment encoded as a Base64 string. Used when attachment data is provided inline rather than from a file. |
| Content | String | False | True | An input stream representing the content of the attachment. Used when 'LocalFile' or 'ContentBytes' is not provided, allowing streaming uploads. |
| UserId | String | False | False | The unique identifier of the user being impersonated when performing the attachment operation. Enables delegated access scenarios. |
Result Set Columns
| Name | Type | Description |
| ContentBytes | String | Returns 'Added Successfully' if the attachment content was successfully added to the target message or event. |
| Id | String | The unique identifier assigned to the newly added attachment. This ID can be used for reference in subsequent operations. |
| LastModifiedDateTime | Datetime | The timestamp indicating when the attachment was last modified. Useful for tracking changes or ensuring version accuracy. |
| Isinline | Boolean | A Boolean value that specifies whether the attachment is an inline element, such as an embedded image in an email or calendar item. |
| Name | String | The name of the attachment that was added. This is the same value as specified in 'FileName'. |
| Contenttype | String | The MIME type of the attachment (for example, application/pdf, image/png), indicating the file format. |
| Size | Int | The size of the attachment, measured in bytes. Useful for validating against size limits or storage policies. |