[][src]Struct lettre::message::MessageBuilder

pub struct MessageBuilder { /* fields omitted */ }

A builder for messages

Implementations

impl MessageBuilder[src]

pub fn new() -> Self[src]

Creates a new default message builder

pub fn header<H: Header>(self, header: H) -> Self[src]

Set custom header to message

pub fn mailbox<H: Header + MailboxesHeader>(self, header: H) -> Self[src]

Add mailbox to header

pub fn date(self, date: EmailDate) -> Self[src]

Add Date header to message

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

pub fn date_now(self) -> Self[src]

Set Date header using current date/time

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

pub fn subject<S: Into<String>>(self, subject: S) -> Self[src]

Set Subject header to message

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

pub fn sender(self, mbox: Mailbox) -> Self[src]

Set Sender header. Should be used when providing several From mailboxes.

https://tools.ietf.org/html/rfc5322#section-3.6.2

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

pub fn from(self, mbox: Mailbox) -> Self[src]

Set or add mailbox to From header

https://tools.ietf.org/html/rfc5322#section-3.6.2

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

pub fn reply_to(self, mbox: Mailbox) -> Self[src]

Set or add mailbox to ReplyTo header

https://tools.ietf.org/html/rfc5322#section-3.6.2

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

pub fn to(self, mbox: Mailbox) -> Self[src]

Set or add mailbox to To header

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

pub fn cc(self, mbox: Mailbox) -> Self[src]

Set or add mailbox to Cc header

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

pub fn bcc(self, mbox: Mailbox) -> Self[src]

Set or add mailbox to Bcc header

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

pub fn in_reply_to(self, id: String) -> Self[src]

Set or add message id to In-Reply-To header

pub fn references(self, id: String) -> Self[src]

Set or add message id to References header

pub fn message_id(self, id: Option<String>) -> Self[src]

Set Message-Id header

Should generally be inserted by the mail relay.

If None is provided, an id will be generated in the <UUID@HOSTNAME>.

pub fn user_agent(self, id: String) -> Self[src]

pub fn envelope(self, envelope: Envelope) -> Self[src]

Force specific envelope (by default it is derived from headers)

pub fn body<T: Into<String>>(self, body: T) -> Result<Message, EmailError>[src]

Plain ASCII body

WARNING: Generally not what you want

pub fn multipart(self, part: MultiPart) -> Result<Message, EmailError>[src]

Create message using mime body (MultiPart)

pub fn singlepart(self, part: SinglePart) -> Result<Message, EmailError>[src]

Create message using mime body (SinglePart)

Trait Implementations

impl Clone for MessageBuilder[src]

impl Debug for MessageBuilder[src]

impl Default for MessageBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,