# Get email content

> Fetch the HTML body, plain text, and headers of a received email with the Receiving API.

A received email holds the **HTML** body, the **plain-text** body, and the message **headers**. Because the webhook carries only metadata, you fetch this content from the [Receiving API](https://www.senddart.com/docs/receiving/get-email-content) using the `email_id` from the event.

> **Warning:** Webhooks do not include the body, headers, or attachment content — only metadata. Call [Retrieve received email](https://www.senddart.com/docs/receiving/get-email-content) for the body and headers, or the [Attachments API](https://www.senddart.com/docs/receiving/attachments) for attachment content. This keeps payloads small for serverless platforms with limited request-body sizes.

## Fetch the content

After the `email.received` webhook arrives, issue a `GET /emails/receiving/:id` with the `email_id` to read `html`, `text`, and `headers`:

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.emails.receiving.get('56761188-7520-42d8-8898-ff6fc54ce618');
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Emails::Receiving.get("56761188-7520-42d8-8898-ff6fc54ce618")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->emails->receiving->get('56761188-7520-42d8-8898-ff6fc54ce618');
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Emails.Receiving.get("56761188-7520-42d8-8898-ff6fc54ce618")
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

received, err := client.Emails.Receiving.Get("56761188-7520-42d8-8898-ff6fc54ce618")
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _received = mb.emails.receiving.get("56761188-7520-42d8-8898-ff6fc54ce618").await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.emails().receiving().get("56761188-7520-42d8-8898-ff6fc54ce618");
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.ReceivedEmailRetrieveAsync("56761188-7520-42d8-8898-ff6fc54ce618");
```

**cURL**

```bash
curl -X GET 'https://www.senddart.com/api/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart emails receiving get 56761188-7520-42d8-8898-ff6fc54ce618
```

## Response

The response is the received-email object, including the parsed `html`, `text`, and `headers`. See [Retrieve received email](https://www.senddart.com/docs/receiving/get-email-content) for the full field reference.

```json
{
  "object": "received_email",
  "id": "56761188-7520-42d8-8898-ff6fc54ce618",
  "from": "onboarding@test.senddart.com",
  "to": ["delivered@test.senddart.com"],
  "subject": "Sending this example",
  "message_id": "<111-222-333@email.example.com>",
  "html": "<p>Hello there!</p>",
  "text": "Hello there!",
  "headers": {
    "From": "onboarding@test.senddart.com",
    "To": "delivered@test.senddart.com",
    "Subject": "Sending this example",
    "Message-ID": "<111-222-333@email.example.com>"
  },
  "read": false,
  "read_at": null,
  "created_at": "2026-02-22T23:41:11.894Z"
}
```

> **Note:** Fetching content does not mark the message read — `read` stays `false` until it is opened in the dashboard Inbox or set with [PATCH /emails/receiving/:id](https://www.senddart.com/docs/api/emails-received-update).

> **Note:** Need the exact bytes that arrived — for example to re-parse MIME or extract inline images? Use the raw download URL exposed on the received email (see [Forward emails](https://www.senddart.com/docs/receiving/forward-emails)) rather than the parsed `html`/`text`.
