pub struct MessageBuilder { /* private fields */ }
Expand description

A builder for messages

Implementations

Creates a new default message builder

Set custom header to message

Add mailbox to header

Add Date: header to message

Shortcut for self.header(header::Date(date)).

Set Date: header using current date/time

Shortcut for self.date(SystemTime::now()).

Set Subject: header to message

Shortcut for self.header(header::Subject(subject.into())).

Set Mime-Version: header to 1.0

Shortcut for self.header(header::MIME_VERSION_1_0).

Set Sender: header

Shortcut for self.header(header::Sender(mbox)).

Set or add mailbox to From: header

Shortcut for self.mailbox(header::From(mbox)).

Set or add mailbox to ReplyTo: header

Shortcut for self.mailbox(header::ReplyTo(mbox)).

Set or add mailbox to To: header

Shortcut for self.mailbox(header::To(mbox)).

Set or add mailbox to Cc: header

Shortcut for self.mailbox(header::Cc(mbox)).

Set or add mailbox to Bcc: header

Shortcut for self.mailbox(header::Bcc(mbox)).

Create message using body

Create message by joining content

Create message using mime body (MultiPart or SinglePart)

Shortcut for self.mime_1_0().join(body).

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.