> 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.CreateDraft

- Component: `appmixer.microsoft.mail.CreateDraft`
- 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.CreateDraft>

Create a draft email.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| To (`toRecipients`) | text | The email address (or comma separated addresses) of the message's recipient(s). |
| CC (`ccRecipients`) | text | The email address (or comma separated addresses) of the message's CC recipient(s). |
| BCC (`bccRecipients`) | text | The email address (or comma separated addresses) of the message's BCC recipient(s). |
| Subject (`subject`) | text | The subject of the message. |
| Content (`content`) | textarea | Text or HTML body of the message. See 'Content type' select. |
| Content type (`contentType`) | select | Select the type of content. |
| Attachments (`attachments`) | expression | Attachments for the email message. |

## Output ports

### Port `email`

| Field | Type | Description |
| --- | --- | --- |
| ID (`id`) | string | - |
| Created Date Time (`createdDateTime`) | string | - |
| Last Modified Date Time (`lastModifiedDateTime`) | string | - |
| Change Key (`changeKey`) | string | - |
| Received Date Time (`receivedDateTime`) | string | - |
| Sent Date Time (`sentDateTime`) | string | - |
| Has Attachments (`hasAttachments`) | boolean | - |
| Internet Message ID (`internetMessageId`) | string | - |
| Subject (`subject`) | string | - |
| Body Preview (`bodyPreview`) | string | - |
| Importance (`importance`) | string | - |
| Parent Folder ID (`parentFolderId`) | string | - |
| Conversation ID (`conversationId`) | string | - |
| Conversation Index (`conversationIndex`) | string | - |
| Is Delivery Receipt Requested (`isDeliveryReceiptRequested`) | boolean | - |
| Is Read Receipt Requested (`isReadReceiptRequested`) | boolean | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.mail.CreateDraft",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Create a draft email.",
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Mail.ReadWrite"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "inspector": {
        "inputs": {
          "toRecipients": {
            "type": "text",
            "index": 1,
            "label": "To",
            "tooltip": "The email address (or comma separated addresses) of the message's recipient(s)."
          },
          "ccRecipients": {
            "type": "text",
            "index": 2,
            "label": "CC",
            "tooltip": "The email address (or comma separated addresses) of the message's CC recipient(s)."
          },
          "bccRecipients": {
            "type": "text",
            "index": 3,
            "label": "BCC",
            "tooltip": "The email address (or comma separated addresses) of the message's BCC recipient(s)."
          },
          "subject": {
            "type": "text",
            "index": 4,
            "label": "Subject",
            "tooltip": "The subject of the message."
          },
          "content": {
            "type": "textarea",
            "index": 5,
            "label": "Content",
            "tooltip": "Text or HTML body of the message. See 'Content type' select."
          },
          "contentType": {
            "type": "select",
            "index": 6,
            "label": "Content type",
            "tooltip": "Select the type of content.",
            "defaultValue": "Text",
            "options": [
              {
                "content": "Text",
                "value": "Text"
              },
              {
                "content": "HTML",
                "value": "HTML"
              }
            ]
          },
          "attachments": {
            "type": "expression",
            "label": "Attachments",
            "tooltip": "Attachments for the email message.",
            "index": 7,
            "levels": [
              "ADD"
            ],
            "fields": {
              "fileId": {
                "type": "filepicker",
                "label": "File",
                "tooltip": "The file to attach.",
                "index": 1
              }
            }
          }
        }
      },
      "schema": {
        "type": "object",
        "properties": {
          "toRecipients": {
            "type": "string"
          },
          "ccRecipients": {
            "type": "string"
          },
          "bccRecipients": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "contentType": {
            "enum": [
              "Text",
              "HTML"
            ]
          },
          "attachments": {}
        },
        "required": [
          "toRecipients",
          "content"
        ]
      }
    }
  ],
  "outPorts": [
    {
      "name": "email",
      "options": [
        {
          "label": "ID",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "AAMkAGI1AAAoZCfHAAA="
          }
        },
        {
          "label": "Created Date Time",
          "value": "createdDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "Last Modified Date Time",
          "value": "lastModifiedDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "Change Key",
          "value": "changeKey",
          "schema": {
            "type": "string",
            "example": "CQAAABYAAAC1gzg_vZ4JR4sATa1T8sDwAA"
          }
        },
        {
          "label": "Received Date Time",
          "value": "receivedDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "Sent Date Time",
          "value": "sentDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "Has Attachments",
          "value": "hasAttachments",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Internet Message ID",
          "value": "internetMessageId",
          "schema": {
            "type": "string",
            "example": "<MWHPR13MB0302_AAMkAGI@MWHPR13MB0302.namprd13.prod.outlook.com>"
          }
        },
        {
          "label": "Subject",
          "value": "subject",
          "schema": {
            "type": "string",
            "example": "Q1 Planning Meeting Notes"
          }
        },
        {
          "label": "Body Preview",
          "value": "bodyPreview",
          "schema": {
            "type": "string",
            "example": "Hi team, here are the notes from our planning meeting..."
          }
        },
        {
          "label": "Importance",
          "value": "importance",
          "schema": {
            "type": "string",
            "example": "normal"
          }
        },
        {
          "label": "Parent Folder ID",
          "value": "parentFolderId",
          "schema": {
            "type": "string",
            "example": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAuAAAD"
          }
        },
        {
          "label": "Conversation ID",
          "value": "conversationId",
          "schema": {
            "type": "string",
            "example": "AAQkAGI1AABScCfHAAA="
          }
        },
        {
          "label": "Conversation Index",
          "value": "conversationIndex",
          "schema": {
            "type": "string",
            "example": "AQHRhkZLzFEOKS1waBcV7Q=="
          }
        },
        {
          "label": "Is Delivery Receipt Requested",
          "value": "isDeliveryReceiptRequested",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Is Read Receipt Requested",
          "value": "isReadReceiptRequested",
          "schema": {
            "type": "boolean",
            "example": false
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
