---
title: "Email to Discord | WebhookRelay"
meta:
  "og:description": "Forward inbound email to a Discord channel automatically. Webhook Relay parses each email and a transform reshapes it into Discord's { content } format."
  "og:title": "Email to Discord"
  description: "Forward inbound email to a Discord channel automatically. Webhook Relay parses each email and a transform reshapes it into Discord's { content } format."
---

![Stripes](https://webhookrelay.com/docs/tutorials/email/discord/images/stripes.svg)

Documentation

**Fundamentals**

# **Email to Discord**

Forward inbound email to a Discord channel automatically. Webhook Relay parses each email and a transform reshapes it into Discord's { content } format.

You get emails you'd rather see in chat — monitoring alerts, contact-form submissions, order confirmations, vendor notifications — and you want them dropped into a **Discord channel** automatically instead of buried in an inbox nobody's watching. The problem: there's no native "email this to Discord" button, and Discord only accepts a specific JSON shape, not a raw email.

[Webhook Relay](https://webhookrelay.com) closes that gap. It gives you an address that **receives inbound email and delivers it as a webhook**, parsing each message into clean JSON. A small transform then reshapes that JSON into the format Discord expects, and the message appears in your channel — no server, no inbox polling, no glue code.

> **Build the message visually:** the free [webhook → Slack/Discord/Teams formatter](https://webhookrelay.com/docs/tutorials/email/discord/webhook-message-formatter/) lets you template the Discord embed and copy the transform.

## [How it works](#how-it-works)

Email comes in, gets parsed, gets reshaped, and lands in Discord — a single hop with a transform in the middle:

```
inbound email  ──▶  Webhook Relay (parse)  ──▶  transform to Discord  ──▶  channel
 (any sender)        (email → JSON)             (serverless function)     (message appears)
```

Webhook Relay does the hard part — accepting SMTP, parsing MIME, handling attachments and SPF/DKIM/DMARC — and hands your function a tidy JSON object. The [transform function](https://webhookrelay.com/docs/tutorials/email/discord/docs/webhooks/functions/) only has to map a couple of fields. This is the same email side that powers [Email to Webhook](https://webhookrelay.com/docs/tutorials/email/discord/email-to-webhook/); here the destination just happens to be Discord.

## [Setup](#setup)

**1. Create a bucket.** In the dashboard, create a bucket — it's the container that ties an input (where email arrives) to outputs (where it's delivered).

**2. Add an email input.** On the bucket, add an _email input_. Webhook Relay gives you a unique address of the form `<uuid>@in.webhookrelay-mail.com`. Anything sent to that address is parsed and POSTed as JSON to the bucket's outputs — see [receive emails as webhooks](https://webhookrelay.com/docs/tutorials/email/discord/docs/email/) for the full setup.

**3. Add a Discord output.** In Discord, open **Server Settings → Integrations → Webhooks → New Webhook**, pick the channel, and **Copy Webhook URL**. Paste that URL as the bucket's output destination.

**4. Attach a transform.** Add the [transform function](https://webhookrelay.com/docs/tutorials/email/discord/docs/webhooks/functions/) below so the parsed email is reshaped into Discord's `{ content }` format before delivery.

**5. Test.** Send an email to your `<uuid>@in.webhookrelay-mail.com` address. Within a second or two it shows up in your Discord channel. If it doesn't, open the bucket's request log to see exactly what was received and delivered.

## [The transform](#the-transform)

Each email arrives as JSON with fields like `from`, `from_name`, `recipient`, `to`, `cc`, `subject`, `date`, `message_id`, `text`, `html`, `headers`, `spf`, `dkim`, `dmarc`, and `attachments`. See the full [payload reference](https://webhookrelay.com/docs/tutorials/email/discord/docs/email/payload/) for every field. In the transform, the body is `r.body` (a string); reshape it and set the new body:

```
const email = JSON.parse(r.body);
const discord = { content: \`📧 **${email.subject}**\nFrom: ${email.from_name || email.from}\n\n${email.text}\` };
r.setBody(JSON.stringify(discord));
r.setHeader("Content-Type", "application/json");
```

That parses the incoming email, builds Discord's expected `{ "content": "..." }` body from the subject, sender and plain-text body, and sets the right header. You can also `r.setResponseStatus(code)` if you need to control what's returned.

A Discord incoming webhook accepts either `{ "content": "..." }` or an `embeds` array — so for a richer card, build an `embeds` object instead (map `email.subject` to the title and `email.text` to the description) and Discord will render it with a title, colored sidebar, and fields.

## [Going further](#going-further)

Want only certain senders to reach Discord? Add a From allowlist with [filtering and policy](https://webhookrelay.com/docs/tutorials/email/discord/docs/email/filtering-and-policy/) so unwanted mail never gets delivered. And because this is the same inbound-email pipeline behind [Email to Webhook](https://webhookrelay.com/docs/tutorials/email/discord/email-to-webhook/), you can point the parsed JSON anywhere — Discord today, Slack, an internal API, or several destinations at once tomorrow.

[Create a free Webhook Relay account](https://my.webhookrelay.com/register), add an email input, and route your first message into Discord in a few minutes — see the [Email to Webhook](https://webhookrelay.com/docs/tutorials/email/discord/email-to-webhook/) pillar for the full picture. Building a Discord [incoming webhook](https://discord.com/developers/docs/resources/webhook)? The format above is everything it needs.

Did this page help you?