[][src]Struct lettre_email::EmailBuilder

pub struct EmailBuilder { /* fields omitted */ }

Builds an Email structure

Methods

impl EmailBuilder[src]

pub fn new() -> EmailBuilder[src]

Creates a new empty email

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

Sets the email body

pub fn header<A: Into<Header>>(self, header: A) -> EmailBuilder[src]

Add a generic header

pub fn from<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a From header and stores the sender address

pub fn to<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a To header and stores the recipient address

pub fn cc<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a Cc header and stores the recipient address

pub fn bcc<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a Bcc header and stores the recipient address

pub fn reply_to<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a Reply-To header

pub fn in_reply_to(self, message_id: MessageId) -> EmailBuilder[src]

Adds a In-Reply-To header

pub fn references(self, message_id: MessageId) -> EmailBuilder[src]

Adds a References header

pub fn sender<A: Into<Mailbox>>(self, address: A) -> EmailBuilder[src]

Adds a Sender header

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

Adds a Subject header

pub fn date(self, date: &Tm) -> EmailBuilder[src]

Adds a Date header with the given date

pub fn attachment_from_file(
    self,
    path: &Path,
    filename: Option<&str>,
    content_type: &Mime
) -> Result<EmailBuilder, Error>
[src]

Adds an attachment to the email from a file

If not specified, the filename will be extracted from the file path.

pub fn attachment(
    self,
    body: &[u8],
    filename: &str,
    content_type: &Mime
) -> Result<EmailBuilder, Error>
[src]

Adds an attachment to the email from a vector of bytes.

pub fn message_type(self, message_type: MimeMultipartType) -> EmailBuilder[src]

Set the message type

pub fn child(self, child: MimeMessage) -> EmailBuilder[src]

Adds a child

pub fn text<S: Into<String>>(self, body: S) -> EmailBuilder[src]

Sets the email body to plain text content

pub fn html<S: Into<String>>(self, body: S) -> EmailBuilder[src]

Sets the email body to HTML content

pub fn alternative<S: Into<String>, T: Into<String>>(
    self,
    body_html: S,
    body_text: T
) -> EmailBuilder
[src]

Sets the email content

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

Sets the envelope for manual destination control If this function is not called, the envelope will be calculated from the "to" and "cc" addresses you set.

pub fn build(self) -> Result<Email, Error>[src]

Builds the Email

Trait Implementations

impl Clone for EmailBuilder[src]

impl Debug for EmailBuilder[src]

impl Default for EmailBuilder[src]

impl Eq for EmailBuilder[src]

impl PartialEq<EmailBuilder> for EmailBuilder[src]

impl StructuralEq for EmailBuilder[src]

impl StructuralPartialEq for EmailBuilder[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>,