Interface ForwardableEmailMessage

An email message that is sent to a consumer Worker and can be rejected/forwarded.

interface ForwardableEmailMessage {
    from: string;
    headers: Headers;
    raw: ReadableStream<Uint8Array>;
    rawSize: number;
    to: string;
    forward(rcptTo, headers?): Promise<void>;
    setReject(reason): void;
}

Hierarchy (view full)

Properties

from: string

Envelope From attribute of the email message.

headers: Headers
raw: ReadableStream<Uint8Array>

Stream of the email message content.

rawSize: number

Size of the email message content.

to: string

Envelope To attribute of the email message.

Methods

  • Forward this email message to a verified destination address of the account.

    Parameters

    Returns Promise<void>

    A promise that resolves when the email message is forwarded.

  • Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.

    Parameters

    • reason: string

      The reject reason.

    Returns void

    void