# Send Email — Amazon SES

> Send an email using Amazon SES. Supports simple email messaging. See the docs

- Key: `amazon_ses-send-email`
- Type: Action (Write)
- Version: 0.9.7
- App: Amazon SES (`amazon_ses`) — https://pipedream.com/apps/amazon-ses.md
- This page (HTML): https://pipedream.com/apps/amazon-ses/actions/send-email
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/amazon_ses/actions/send-email/send-email.mjs

## Description

Send an email using Amazon SES. Supports simple email messaging. [See the docs](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sesv2/classes/sendemailcommand.html)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `region` | `string` | Yes | The AWS region Options are loaded from the connected account. |
| `ToAddresses` | `string[]` | Yes | An array of recipient email addresses you want to send to |
| `CcAddresses` | `string[]` | No | An array of email addresses you want to CC |
| `BccAddresses` | `string[]` | No | An array of email addresses you want to BCC |
| `ReplyToAddresses` | `string[]` | No | An array of reply-to addresses |
| `Subject` | `string` | Yes | The email subject line. Use \{\{ and \}\} to insert tags. Example: This is a \{\{tagname\}\}. |
| `Text` | `string` | Yes | The email body that will be visible to recipients whose email clients do not display HTML. Use \{\{ and \}\} to insert tags. Example: This is a \{\{tagname\}\}. |
| `Html` | `string` | No | The HTML email body. Use \{\{ and \}\} to insert tags. Example: This is a \{\{tagname\}\}. |
| `FromEmailAddress` | `string` | Yes | The email from which the email is addressed |
| `attachments` | `string[]` | No | File paths (e.g., /tmp/file.pdf) or URLs to attach to the email. Files will be automatically base64-encoded and MIME types auto-detected. |
| `inlineAttachments` | `object` | No | Object mapping Content IDs to file paths/URLs for inline images in HTML emails. Example: {"logo": "/tmp/logo.png"}. Reference in HTML as <img src="cid:logo"> |
| `syncDir` | `dir` | Yes | 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": "amazon_ses",
      },
    },
  },
)

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: "amazon_ses-send-email",
  arguments: {
    region: "AWS Region",
    ToAddresses: ["To Addresses"],
  },
})
```

**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: "amazon_ses-send-email",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    amazon_ses: { authProvisionId: "apn_xxxxxxx" },
    region: "AWS Region",
    ToAddresses: ["To Addresses"],
  },
})

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": "amazon_ses-send-email",
    "configured_props": {
      "amazon_ses": { "authProvisionId": "apn_xxxxxxx" },
      "region": "AWS Region",
      "ToAddresses": ["To Addresses"]
    }
  }'
```

---

- App: https://pipedream.com/apps/amazon-ses.md · All apps: https://pipedream.com/apps
