> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Draft email

> Create an unsent Outlook email draft.

`draftEmail` creates a formatted draft and returns its message record. Use the
returned `messageId` to update, attach files, or send it later.

## Example

```ts automations/draft-outlook-email.automation.ts theme={null}
import { automation } from "automate.ax"
import { draftEmail } from "automate.ax/outlook"

export default automation("Draft Outlook email", () => {
  draftEmail({
    to: "reviewer@example.com",
    subject: "Draft launch note",
    body: "Please review this note before sending.",
  })
})
```

## Inputs

Requires non-empty `to`, `subject`, and `body`. `bodyType` defaults to `text`.
Optional `cc`, `bcc`, and `replyTo` accept email strings or `{ address, name? }`
objects, singly or as arrays. `importance`, receipt-request booleans,
`attachments: File[]`, and `account` are optional. Direct attachments are each
limited to 3,000,000 bytes.

## Output

Returns the created `OutlookMessage`, normally with `isDraft: true`, its stable
`messageId`, and Graph's available recipients, body, state, IDs, timestamps, and
web metadata. Pass `messageId` to `sendDraft` after review.
