# 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.sendping.co/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.sendping.co/docs/receiving/get-email-content) for the body and headers, or the [Attachments API](https://www.sendping.co/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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

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

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

```bash
sendping 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.sendping.co/docs/receiving/get-email-content) for the full field reference.

```json
{
  "object": "received_email",
  "id": "56761188-7520-42d8-8898-ff6fc54ce618",
  "from": "onboarding@test.sendping.co",
  "to": ["delivered@test.sendping.co"],
  "subject": "Sending this example",
  "message_id": "<111-222-333@email.example.com>",
  "html": "<p>Hello there!</p>",
  "text": "Hello there!",
  "headers": {
    "From": "onboarding@test.sendping.co",
    "To": "delivered@test.sendping.co",
    "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.sendping.co/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.sendping.co/docs/receiving/forward-emails)) rather than the parsed `html`/`text`.
