[−][src]Struct lettre_email::EmailBuilder
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]
self,
path: &Path,
filename: Option<&str>,
content_type: &Mime
) -> Result<EmailBuilder, Error>
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]
self,
body: &[u8],
filename: &str,
content_type: &Mime
) -> Result<EmailBuilder, Error>
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]
self,
body_html: S,
body_text: T
) -> EmailBuilder
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]
fn clone(&self) -> EmailBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EmailBuilder
[src]
impl Default for EmailBuilder
[src]
fn default() -> EmailBuilder
[src]
impl Eq for EmailBuilder
[src]
impl PartialEq<EmailBuilder> for EmailBuilder
[src]
fn eq(&self, other: &EmailBuilder) -> bool
[src]
fn ne(&self, other: &EmailBuilder) -> bool
[src]
impl StructuralEq for EmailBuilder
[src]
impl StructuralPartialEq for EmailBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for EmailBuilder
impl Send for EmailBuilder
impl Sync for EmailBuilder
impl Unpin for EmailBuilder
impl UnwindSafe for EmailBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,