# Forward Received Email

> POST /emails/receiving/:id/forward — forward a received email (with its attachments) to another address.

`POST /emails/receiving/:id/forward`

Forwards a received email to another address through the normal send pipeline. The original subject, body, and attachments are re-sent (inline images keep their `content_id` so they still render). `from` must be an address on one of your verified domains — it is validated exactly like [POST /emails](https://www.mailblastr.com/docs/api/emails-send).

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The id of the received email to forward. |

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | string | string[] | Yes | The address(es) to forward to. |
| `from` | string | Yes | A verified sending address. |
| `subject` | string | No | Optional; overrides the original subject. |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.emails.receiving.forward('4ef9a417-02e9-4d39-ad75-9611e0fcc33c', {
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
});
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Emails::Receiving.forward("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", {
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
})
```

**PHP**

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

$mailblastr->emails->receiving->forward('4ef9a417-02e9-4d39-ad75-9611e0fcc33c', [
  'to' => "teammate@example.com",
  'from' => "Acme <hello@yourdomain.com>"
]);
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Emails.Receiving.forward("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", {
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
})
```

**Go**

```go
package main

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

func main() {
    req, _ := http.NewRequest("POST", "https://api.mailblastr.com/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/forward", strings.NewReader(`{
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
}`))
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    req.Header.Set("Content-Type", "application/json")
    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()
        .post("https://api.mailblastr.com/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/forward")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .header("Content-Type", "application/json")
        .body(r#"{
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
}"#)
        .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/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/forward"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
}
"""))
    .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.Post, "https://api.mailblastr.com/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/forward");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
request.Content = new StringContent(@"{
  ""to"": ""teammate@example.com"",
  ""from"": ""Acme <hello@yourdomain.com>""
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X POST 'https://api.mailblastr.com/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/forward' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": "teammate@example.com",
  "from": "Acme <hello@yourdomain.com>"
}'
```

**CLI**

```bash
mailblastr emails receiving forward 4ef9a417-02e9-4d39-ad75-9611e0fcc33c \
  --to 'teammate@example.com' \
  --from 'Acme <hello@yourdomain.com>'
```

## Response

```json
{
  "object": "email",
  "id": "6278820d-2421-42d0-85f0-80e9e28c1c69"
}
```

The response is the outbound email's id — the forward is sent like any other email and shows up in your sent mail and logs. Attachments whose bytes were not retained (e.g. inbound storage was off when the mail arrived) are skipped rather than failing the forward. Returns `not_found` (404) if the received email does not exist for your account, and `missing_required_field` (422) when `to` or `from` is omitted. See the [error reference](https://www.mailblastr.com/docs/api/errors).
