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

    Class AddressError

    A mailbox address that could not be parsed.

    Instances carry a stable AddressError.kind so callers can branch on the failure without matching message text. Errors raised while validating a Message are collected in an AggregateError and keep their kind.

    try {
    await client.send(new Message().from("noreply@acme.example").to(input));
    } catch (error) {
    if (error instanceof AggregateError) {
    for (const problem of error.errors) {
    if (problem instanceof AddressError && problem.kind === addressErrorKind.invalidDomain) {
    // The domain is not resolvable as a DNS name.
    }
    }
    }
    }

    Hierarchy

    • Error
      • AddressError
    Index
    • Parameters

      • options: { cause?: unknown; kind: AddressErrorKind; message: string }

        The failure kind, a human-readable description, and the underlying error when this error wraps one.

      Returns AddressError

    The classified reason the address was rejected.