---
title: "Email to Microsoft Teams | WebhookRelay"
meta:
  "og:description": "Route inbound email into a Microsoft Teams channel automatically. Webhook Relay receives each email, parses it to JSON, and a transform reshapes it into a Teams card."
  "og:title": "Email to Microsoft Teams"
  description: "Route inbound email into a Microsoft Teams channel automatically. Webhook Relay receives each email, parses it to JSON, and a transform reshapes it into a Teams card."
---

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

Documentation

**Fundamentals**

# **Email to Microsoft Teams**

Route inbound email into a Microsoft Teams channel automatically. Webhook Relay receives each email, parses it to JSON, and a transform reshapes it into a Teams card.

Plenty of useful signals still arrive as **email** — alert notifications from legacy systems, approval requests, scheduled reports, vendor updates. If your team lives in **Microsoft Teams**, copy-pasting those messages out of a shared inbox is tedious and easy to drop. You want each email to land in a Teams channel automatically.

[Webhook Relay](https://webhookrelay.com) does exactly that. It gives you an inbound email address, **parses every message it receives into clean JSON**, and POSTs it to your outputs. Add a small transform that reshapes the parsed email into a Teams card, point the output at your Teams webhook URL, and every email becomes a channel message — no glue server, no inbox polling.

> **Build it visually first:** the free [webhook → Slack/Discord/Teams formatter](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/webhook-message-formatter/) lets you paste a sample payload, template the message, preview it live, and copy the exact transform function — for any incoming payload, including a parsed email.

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

The flow is a single hop with a transform in the middle:

```
inbound email  ──▶  Webhook Relay  ──▶  transform to Teams card  ──▶  Teams channel
 (to your addr)     (parse to JSON)     (serverless function)        (message appears)
```

Webhook Relay handles SMTP, parsing, SPF/DKIM/DMARC checks, and attachments for you. By the time the email reaches your transform it's already structured JSON — see [Email to Webhook](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/email-to-webhook/) for the full picture of [receiving emails as webhooks](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/docs/email/).

## [Step 1: Create a bucket](#step-1-create-a-bucket)

A bucket is the container that ties an input (where data arrives) to outputs (where it goes). Create one in the dashboard — it's where you'll add the email input and the Teams output.

## [Step 2: Add an email input](#step-2-add-an-email-input)

On the bucket, add an **email input**. Webhook Relay generates a unique address:

```
<uuid>@in.webhookrelay-mail.com
```

Any message sent to that address is parsed and POSTed to the bucket's outputs as JSON. The parsed payload looks like this (see the full [payload reference](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/docs/email/payload/)):

```
{
  "from": "alerts@example.com",
  "from_name": "Monitoring",
  "recipient": "<uuid>@in.webhookrelay-mail.com",
  "to": ["<uuid>@in.webhookrelay-mail.com"],
  "cc": [],
  "subject": "Disk usage above 90% on db-01",
  "date": "2026-06-28T11:59:00Z",
  "message_id": "<...>",
  "text": "db-01 root volume is at 92%.",
  "html": "<p>db-01 root volume is at 92%.</p>",
  "headers": {},
  "spf": "pass",
  "dkim": "pass",
  "dmarc": "pass",
  "attachments": [
    { "name": "report.csv", "content_type": "text/csv", "size": 1024, "content": "", "truncated": false }
  ]
}
```

## [Step 3: Add the Teams output](#step-3-add-the-teams-output)

Add an output to the bucket and set its destination to your **Teams Incoming Webhook** URL (created via a Power Automate Workflow, or a legacy Office 365 connector). Keep that URL handy — it's where the transformed message gets delivered.

## [Step 4: Attach a transform](#step-4-attach-a-transform)

Right now the parsed email would be POSTed to Teams as-is, and Teams would reject it because the shape is wrong. Attach a [transform function](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/docs/webhooks/functions/) to the output to convert the parsed email into a Teams **MessageCard**:

```
const email = JSON.parse(r.body);

const card = {
  "@type": "MessageCard",
  "@context": "https://schema.org/extensions",
  summary: email.subject,
  title: email.subject,
  text: \`**From:** ${email.from_name || email.from}\n\n${email.text}\`
};

r.setBody(JSON.stringify(card));
r.setHeader("Content-Type", "application/json");
```

The function reads `r.body` (the parsed-email JSON string), pulls out the subject, sender and body, and writes a MessageCard back with `r.setBody()`. Setting `Content-Type: application/json` with `r.setHeader()` ensures Teams accepts it. You can also call `r.setResponseStatus()` if you need to control the response returned to the sender.

**A note on Adaptive Cards.** Microsoft is migrating Incoming Webhooks away from Office 365 connectors toward Power Automate Workflows, where the modern format is an **Adaptive Card** wrapped in an `attachments` array. The pattern is identical — parse the email, build the card object, `r.setBody(JSON.stringify(...))` — only the JSON shape differs to match whichever URL you were given.

## [Step 5: Test it](#step-5-test-it)

Send a plain email to your `<uuid>@in.webhookrelay-mail.com` address. Within a second or two the subject and body appear as a card in your Teams channel. If nothing shows up, open the request log in your dashboard to see exactly what was received, transformed, and delivered.

## [Wrapping up](#wrapping-up)

That's a complete email-to-Teams bridge: an email input parses each message, a transform reshapes it into a Teams card, and the output delivers it — all in the cloud with nothing to host. The same building blocks cover any destination; see [Email to Webhook](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/email-to-webhook/) for the broader pattern and the [formatter](https://webhookrelay.com/docs/tutorials/email/microsoft-teams/webhook-message-formatter/) to template your card without writing code by hand.

Did this page help you?