Struct lettre_email::EmailBuilder
[−]
[src]
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 set_body<S: Into<String>>(&mut self, body: S)
[src]
Sets the email body
pub fn header<A: IntoHeader>(self, header: A) -> EmailBuilder
[src]
Add a generic header
pub fn add_header<A: IntoHeader>(&mut self, header: A)
[src]
Add a generic header
pub fn from<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a From
header and stores the sender address
pub fn add_from<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a From
header and stores the sender address
pub fn to<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a To
header and stores the recipient address
pub fn add_to<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a To
header and stores the recipient address
pub fn cc<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a Cc
header and stores the recipient address
pub fn add_cc<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a Cc
header and stores the recipient address
pub fn bcc<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a Bcc
header and stores the recipient address
pub fn add_bcc<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a Bcc
header and stores the recipient address
pub fn reply_to<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a Reply-To
header
pub fn add_reply_to<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a Reply-To
header
pub fn sender<A: IntoMailbox>(self, address: A) -> EmailBuilder
[src]
Adds a Sender
header
pub fn set_sender<A: IntoMailbox>(&mut self, address: A)
[src]
Adds a Sender
header
pub fn subject<S: Into<String>>(self, subject: S) -> EmailBuilder
[src]
Adds a Subject
header
pub fn set_subject<S: Into<String>>(&mut self, subject: S)
[src]
Adds a Subject
header
pub fn date(self, date: &Tm) -> EmailBuilder
[src]
Adds a Date
header with the given date
pub fn set_date(&mut self, date: &Tm)
[src]
Adds a Date
header with the given date
pub fn attachment(
self,
path: &Path,
filename: Option<&str>,
content_type: &Mime
) -> Result<EmailBuilder, Error>
[src]
self,
path: &Path,
filename: Option<&str>,
content_type: &Mime
) -> Result<EmailBuilder, Error>
Adds an attachment to the email
pub fn set_attachment(
&mut self,
path: &Path,
filename: Option<&str>,
content_type: &Mime
) -> Result<(), Error>
[src]
&mut self,
path: &Path,
filename: Option<&str>,
content_type: &Mime
) -> Result<(), Error>
Adds an attachment to the email If filename is not provided, the name of the file will be used.
pub fn message_type(self, message_type: MimeMultipartType) -> EmailBuilder
[src]
Set the message type
pub fn set_message_type(&mut self, message_type: MimeMultipartType)
[src]
Set the message type
pub fn child(self, child: MimeMessage) -> EmailBuilder
[src]
Adds a child
pub fn add_child(&mut self, child: MimeMessage)
[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 set_text<S: Into<String>>(&mut self, body: S)
[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 set_html<S: Into<String>>(&mut self, body: S)
[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]
self,
body_html: S,
body_text: T
) -> EmailBuilder
Sets the email content
pub fn set_alternative<S: Into<String>, T: Into<String>>(
&mut self,
body_html: S,
body_text: T
)
[src]
&mut self,
body_html: S,
body_text: T
)
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 set_envelope(&mut self, envelope: Envelope)
[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 PartialEq for EmailBuilder
[src]
fn eq(&self, __arg_0: &EmailBuilder) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &EmailBuilder) -> bool
[src]
This method tests for !=
.
impl Eq for EmailBuilder
[src]
impl Clone for EmailBuilder
[src]
fn clone(&self) -> EmailBuilder
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for EmailBuilder
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for EmailBuilder
[src]
fn default() -> EmailBuilder
[src]
Returns the "default value" for a type. Read more