Get attachment content
mail_get_attachment_contentRetrieve a specific email attachment's content by message ID and attachment ID. Returns text or base64 for files under 1 MB, sourceUrl for links, or a pointer to files_parse_document for large files.
Instructions
Returns the content of one message attachment. A file attachment under 1 MB comes back as text when it is text-like, or as base64 otherwise; larger files are refused with a pointer at files_parse_document, which reads them through $value instead. A reference attachment (a link, not a file) comes back as its sourceUrl — pass that as shareUrl to files_resolve_share or files_parse_document. Check kind on mail_list_attachments first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The message id, as returned by mail_list_messages. | |
| maxChars | No | Maximum characters of text (or base64) to return. Defaults to 20000; longer content is cut with a marker. | |
| attachmentId | Yes | The attachment id, as returned by mail_list_attachments. |