[−][src]Struct lettre::message::MessageBuilder
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]
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]
fn clone(&self) -> MessageBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MessageBuilder
[src]
impl Default for MessageBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl !Sync for MessageBuilder
impl Unpin for MessageBuilder
impl !UnwindSafe for MessageBuilder
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,