> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailr.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Forward Receiving Emails

> Forward Receiving emails to another email address.

Receiving emails can also be forwarded to another email address.

<Info>
  Webhooks do not include the actual HTML or Plain Text body of the email. You
  must call the [received emails
  API](/docs/api/emails/get-email) to retrieve them. This
  design choice supports large payloads in serverless environments that have
  limited request body sizes.
</Info>

To forward an email, use the [Send Email API](/docs/api/emails/send-email).

After receiving the webhook event, call the [Receiving API](/docs/api/emails/get-email) (and the Attachments API if you want to include attachments). Then forward the email using the [Send Email API](/docs/api/emails/send-email).

Here's an example of forwarding an email in a Next.js application:

```js app/api/events/route.ts theme={null} theme={null}
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { Emailr } from 'emailr';

const emailr = new Emailr('em_xxxxxxxxx');

export const POST = async (request: NextRequest) => {
  const event = await request.json();

  if (event.type === 'email.received') {
    const { data: email } = await emailr
      .emails
      .receiving
      .get(event.data.email_id);

    const { data: attachments } = await emailr
      .attachments
      .receiving
      .list({ emailId: event.data.email_id });

    // download the attachments and encode them in base64
    for (const attachment of attachments.data) {
      const response = await fetch(attachment.download_url);
      const buffer = Buffer.from(await response.arrayBuffer());
      attachment.content = buffer.toString('base64');
    }

    const { data, error } = await emailr.emails.send({
      from: 'Acme <onboarding@emailr.dev>',
      to: ['delivered@emailr.dev'],
      subject: event.data.subject,
      html: email.html,
      text: email.text,
      attachments
    });

    return NextResponse.json(data);
  }

  return NextResponse.json({});
};
```
