sendr/message/mailbox

This module provides a lax representation of a mailbox as defined in RFC 5322, section 3.4.1.

It does not enforce any of the rules and requirements of the RFC. Since we do not know what transformations the Mail Submission Agent will perform and what the Mail Submission Agent is capable of handling.

Types

A mailbox receives mail. Normally, a mailbox is composed of two parts: (1) a display name that indicates the name of the recipient (which can be a person or a system), and (2) an address which systems use to deliver the email.

pub type Mailbox {
  Mailbox(name: String, address: String)
}

Constructors

  • Mailbox(name: String, address: String)

Values

pub const empty: Mailbox

A new empty Mailbox. This is the same as new("", "").

pub fn new(
  display name: String,
  email address: String,
) -> Mailbox

Creates a new Mailbox with a display name and an address. The display name and address are trimmed of leading and trailing whitespace.

Search Document