# 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.sendping.co/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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Emails::Receiving.forward("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", {
  "to": "delivered@test.sendping.co",
  "from": "Acme <hello@yourdomain.com>"
})
```

**PHP**

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

use SendPing\SendPing;

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

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

forwarded, err := client.Emails.Receiving.Forward("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", &sendping.ForwardReceivedEmailRequest{
    To:   []string{"delivered@test.sendping.co"},
    From: "Acme <hello@yourdomain.com>",
})
```

**Rust**

```rust
use sendping::{ForwardReceivedEmailOptions, SendPing};

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

let params = ForwardReceivedEmailOptions::new(
    "Acme <hello@yourdomain.com>",
    ["delivered@test.sendping.co"],
);
let _forwarded = mb.emails.receiving.forward("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", params).await?;
```

**Java**

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

SendPing sendping = new SendPing("mb_xxxxxxxxx");

ForwardEmailRequest request = ForwardEmailRequest.builder()
        .to("delivered@test.sendping.co")
        .from("Acme <hello@yourdomain.com>")
        .build();

SendPingResponse response = sendping.emails().receiving().forward(
        "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
        request);
```

**.NET**

```csharp
using SendPing;

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

var resp = await sendping.ReceivedEmailForwardAsync("4ef9a417-02e9-4d39-ad75-9611e0fcc33c", new ReceivedEmailForwardOptions
{
    To = "delivered@test.sendping.co",
    From = "Acme <hello@yourdomain.com>",
});
```

**cURL**

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

**CLI**

```bash
sendping emails receiving forward 4ef9a417-02e9-4d39-ad75-9611e0fcc33c \
  --to 'delivered@test.sendping.co' \
  --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.sendping.co/docs/api/errors).
