> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.microsoft.mail.AddAttachment

- Component: `appmixer.microsoft.mail.AddAttachment`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.microsoft.mail 2.3.0](https://connectors.appmixer.com/connector/appmixer.microsoft.mail/2.3.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.microsoft.mail/2.3.0/component/appmixer.microsoft.mail.AddAttachment>

Adds a file attachment to a draft email message. Files of 3 MB and more are uploaded in chunks; the maximum size is 150 MB.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Message ID (`messageId`) | text | The ID of the draft message to attach the file to, e.g. the ID returned by Create Draft. |
| File (`fileId`) | filepicker | The file to attach. Select a file from your computer or map the File ID of a file stored by a previous component. |
| File Name (`fileName`) | text | The attachment name shown in the email. Defaults to the name of the stored file. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Attachment ID (`id`) | string | - |
| Name (`name`) | string | - |
| Content Type (`contentType`) | string | - |
| Size (`size`) | integer | - |
| Is Inline (`isInline`) | boolean | - |
| Last Modified Date Time (`lastModifiedDateTime`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.mail.AddAttachment",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Adds a file attachment to a draft email message. Files of 3 MB and more are uploaded in chunks; the maximum size is 150 MB.",
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Mail.ReadWrite"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string"
          },
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          }
        },
        "required": [
          "messageId",
          "fileId"
        ]
      },
      "inspector": {
        "inputs": {
          "messageId": {
            "type": "text",
            "index": 1,
            "label": "Message ID",
            "tooltip": "The ID of the draft message to attach the file to, e.g. the ID returned by Create Draft."
          },
          "fileId": {
            "type": "filepicker",
            "index": 2,
            "label": "File",
            "tooltip": "The file to attach. Select a file from your computer or map the File ID of a file stored by a previous component."
          },
          "fileName": {
            "type": "text",
            "index": 3,
            "label": "File Name",
            "tooltip": "The attachment name shown in the email. Defaults to the name of the stored file."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "Attachment ID",
            "example": "AAMkAGI2THVSAAA="
          },
          "name": {
            "type": "string",
            "title": "Name",
            "example": "invoice.pdf"
          },
          "contentType": {
            "type": "string",
            "title": "Content Type",
            "example": "application/pdf"
          },
          "size": {
            "type": "integer",
            "title": "Size",
            "example": 48213
          },
          "isInline": {
            "type": "boolean",
            "title": "Is Inline",
            "example": false
          },
          "lastModifiedDateTime": {
            "type": "string",
            "title": "Last Modified Date Time",
            "example": "2026-01-15T11:05:00Z"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
