# Send Email — Microsoft Outlook Email

> Send a new email, reply to an existing message, or save a draft — all in one tool. Omit inReplyToMessageId to send a new email. Provide inReplyToMessageId to reply to an existing message (threads correctly). Set isDraft: true to save to…

- Key: `microsoft_outlook-send-email`
- Type: Action (Write)
- Version: 0.1.5
- App: Microsoft Outlook Email (`microsoft_outlook`) — https://pipedream.com/apps/microsoft-outlook.md
- This page (HTML): https://pipedream.com/apps/microsoft-outlook/actions/send-email
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_outlook/actions/send-email/send-email.mjs

## Description

Send a new email, reply to an existing message, or save a draft — all in one tool. Omit `inReplyToMessageId` to send a new email. Provide `inReplyToMessageId` to reply to an existing message (threads correctly). Set `isDraft: true` to save to Drafts instead of sending immediately. Attach files by passing URLs or `/tmp` paths to `files`. Example (send new): `send-email(recipients=["you@example.com"], subject="Hello", content="Hi there")` Example (reply): `send-email(inReplyToMessageId="AAMk...", content="Thanks for your note")` Example (draft): `send-email(recipients=["boss@example.com"], subject="Weekly report", content="...", isDraft=true)` Use **Find Email** to locate a message `id` before replying. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-sendmail)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `recipients` | `string[]` | No | Array of recipient email addresses, e.g. ["alice@example.com", "bob@example.com"]. |
| `ccRecipients` | `string[]` | No | Array of CC recipient email addresses. |
| `bccRecipients` | `string[]` | No | Array of BCC recipient email addresses. |
| `subject` | `string` | No | Email subject line. |
| `content` | `string` | No | Email body content in text or HTML format. |
| `contentType` | `string` | No | Content type of the body: text (default) or html. |
| `inReplyToMessageId` | `string` | No | When set, threads the message as a reply to this message ID. Obtain from Find Email (id field). Omit for a new email. |
| `isDraft` | `boolean` | No | When true, saves the message to Drafts instead of sending. Default: false. |
| `files` | `string[]` | No | File URLs or /tmp paths to attach. Example: ["/tmp/report.pdf"]. |
| `userId` | `string` | No | The user ID or UPN of a shared mailbox to send from. Omit to use the authenticated user's mailbox. |
| `syncDir` | `dir` | No | SyncDir |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "microsoft_outlook",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "microsoft_outlook-send-email",
  arguments: {
    recipients: ["To"],
    ccRecipients: ["CC"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_outlook-send-email",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_outlook: { authProvisionId: "apn_xxxxxxx" },
    recipients: ["To"],
    ccRecipients: ["CC"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "microsoft_outlook-send-email",
    "configured_props": {
      "microsoft_outlook": { "authProvisionId": "apn_xxxxxxx" },
      "recipients": ["To"],
      "ccRecipients": ["CC"]
    }
  }'
```

---

- App: https://pipedream.com/apps/microsoft-outlook.md · All apps: https://pipedream.com/apps
