Rust

An email as a MIME message on the wire, which the SMTP adapter hands over whole and SES sends as a raw message per recipient.

Contents

use utopia_messaging::email::mime::addresses;
Rust
pub fn addresses(recipients: &[Mailbox]) -> Result<Vec<Address>, Error>

The recipients as addresses (a missing name is empty).

use utopia_messaging::email::mime::attachments;
Rust
pub fn attachments(email: &Email) -> Result<Vec<Attachment>, Error>

The email's attachments: read from their path when written, or from the content given.

use utopia_messaging::email::mime::message;
Rust
pub fn message(email: &Email, to: &[Mailbox], cc: &[Mailbox], bcc: &[Mailbox], headers: &[(String, String)]) -> Result<Message, Error>

The message for email, addressed to to and cc, with bcc in the envelope only, and headers of the adapter's own (X-Mailer), which win over the email's headers of the same name in any case.

The text part is the content, or for HTML the content without style blocks and tags.

use utopia_messaging::email::mime::size;
Rust
pub fn size(email: &Email) -> Result<u64, Error>

What the attachments weigh before they are encoded.

Fails with Error::Exception for a file that cannot be read.