# Send Message — Mailjet

> Send a message via Send API v3. Send API v3 is built mainly for speed, allowing you to send up to 100 messages in a single API call. See the docs here

- Key: `mailjet-send-message`
- Type: Action (Write)
- Version: 0.0.5
- App: Mailjet (`mailjet`) — https://pipedream.com/apps/mailjet.md
- This page (HTML): https://pipedream.com/apps/mailjet/actions/send-message
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/mailjet/actions/send-message/send-message.mjs

## Description

Send a message via Send API v3. Send API v3 is built mainly for speed, allowing you to send up to 100 messages in a single API call. [See the docs here](https://dev.mailjet.com/email/reference/send-emails/#v3_1_post_send)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `fromEmail` | `string` | Yes | Specifies the sender email address. |
| `fromName` | `string` | No | Sender name that will be displayed in the recipient's mailbox. |
| `sender` | `boolean` | No | When true, default sender email address will be used to send the message, while the From Email will be displayed in the recipient's inbox. In such cases, it is not necessary for the From Email to be verified. However, the information will be displayed in the inbox as From {from_email} via / sent on behalf of {sender_domain}. |
| `to` | `string` | No | The email address (and name, optionally) of the recipients. Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas. Can be used together with Cc and Bcc. |
| `cc` | `string` | No | The email address (and name, optionally) of a recipient who is supposed to receive a carbon copy (cc) of this message. Used together with To and Bcc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas. |
| `bcc` | `string` | No | The email address (and name, optionally) of a recipient who is supposed to receive a blind carbon copy (bcc) of this message. Use this when you do not want your other recipients to see that you are sending a copy of the message to this email address. Used together with To and Cc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas. |
| `subject` | `string` | No | The email subject line. |
| `textPart` | `string` | No | Provides the Text part of the message. Mandatory, if the Html-part parameter is not specified. |
| `htmlPart` | `string` | No | Provides the HTML part of the message. Mandatory, if the Text-part parameter is not specified. |

## 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": "mailjet",
      },
    },
  },
)

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: "mailjet-send-message",
  arguments: {
    fromEmail: "From Email",
    fromName: "From Name",
  },
})
```

**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: "mailjet-send-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mailjet: { authProvisionId: "apn_xxxxxxx" },
    fromEmail: "From Email",
    fromName: "From Name",
  },
})

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": "mailjet-send-message",
    "configured_props": {
      "mailjet": { "authProvisionId": "apn_xxxxxxx" },
      "fromEmail": "From Email",
      "fromName": "From Name"
    }
  }'
```

---

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