@mxraven/mail - v0.2.0
    Preparing search index...

    Class Client

    Submits mail to the mxRaven SMTP submission service.

    A client maintains a bounded pool of authenticated connections and is safe for concurrent use. The submission service requires STARTTLS and SMTP AUTH, so both are always used.

    const secret = process.env.MXRAVEN_SECRET;
    if (secret === undefined || secret === "") {
    throw new Error("MXRAVEN_SECRET is required");
    }

    const client = new Client({
    host: "smtp.mxraven.com",
    username: "mxr_tx_ab12cd34ef56",
    secret,
    });
    const result = await client.send(
    new Message().from("noreply@acme.example").to("customer@example.com").text("Hi"),
    );
    await client.close();
    Index
    • Releases the pooled connections. It is safe to call more than once.

      Returns Promise<void>

    • Streams an already serialized RFC 5322 message with an explicit envelope.

      The message is not parsed, so the caller is responsible for RFC 5322 correctness. Prefer this for large or pre-rendered messages.

      Parameters

      • envelope: Envelope

        The SMTP envelope, independent of the message headers.

      • data:
            | Uint8Array<ArrayBufferLike>
            | AsyncIterable<Uint8Array<ArrayBufferLike>, any, any>

        The raw message bytes, or an async stream of chunks.

      • options: SendOptions = {}

        An optional cancellation signal.

      Returns Promise<Result>

      The server's result for the submission.

      SMTPError When the server rejects a command.

      SMTPTransactionError When every recipient is rejected.