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

const mb = new MailBlastr('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

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

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

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

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

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

**Go**

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618", nil)
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .get("https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

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

**CLI**

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

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

> **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.mailblastr.com/docs/receiving/forward-emails)) rather than the parsed `html`/`text`.
