pub struct MessageBuilder { /* private fields */ }
Expand description
A builder for messages
Implementations§
Source§impl MessageBuilder
impl MessageBuilder
Sourcepub fn mailbox<H: Header + MailboxesHeader>(self, header: H) -> Self
pub fn mailbox<H: Header + MailboxesHeader>(self, header: H) -> Self
Add mailbox to header
Sourcepub fn date(self, date: EmailDate) -> Self
pub fn date(self, date: EmailDate) -> Self
Add Date:
header to message
Shortcut for self.header(header::Date(date))
.
Sourcepub fn date_now(self) -> Self
pub fn date_now(self) -> Self
Set Date:
header using current date/time
Shortcut for self.date(SystemTime::now())
.
Sourcepub fn subject<S: Into<String>>(self, subject: S) -> Self
pub fn subject<S: Into<String>>(self, subject: S) -> Self
Set Subject:
header to message
Shortcut for self.header(header::Subject(subject.into()))
.
Sourcepub fn mime_1_0(self) -> Self
pub fn mime_1_0(self) -> Self
Set Mime-Version:
header to 1.0
Shortcut for self.header(header::MIME_VERSION_1_0)
.
Sourcepub fn sender(self, mbox: Mailbox) -> Self
pub fn sender(self, mbox: Mailbox) -> Self
Set Sender:
header
Shortcut for self.header(header::Sender(mbox))
.
Sourcepub fn from(self, mbox: Mailbox) -> Self
pub fn from(self, mbox: Mailbox) -> Self
Set or add mailbox to From:
header
Shortcut for self.mailbox(header::From(mbox))
.
Sourcepub fn reply_to(self, mbox: Mailbox) -> Self
pub fn reply_to(self, mbox: Mailbox) -> Self
Set or add mailbox to ReplyTo:
header
Shortcut for self.mailbox(header::ReplyTo(mbox))
.
Sourcepub fn to(self, mbox: Mailbox) -> Self
pub fn to(self, mbox: Mailbox) -> Self
Set or add mailbox to To:
header
Shortcut for self.mailbox(header::To(mbox))
.
Sourcepub fn cc(self, mbox: Mailbox) -> Self
pub fn cc(self, mbox: Mailbox) -> Self
Set or add mailbox to Cc:
header
Shortcut for self.mailbox(header::Cc(mbox))
.
Sourcepub fn bcc(self, mbox: Mailbox) -> Self
pub fn bcc(self, mbox: Mailbox) -> Self
Set or add mailbox to Bcc:
header
Shortcut for self.mailbox(header::Bcc(mbox))
.
Sourcepub fn mime_body<T>(self, body: T) -> Message<T>
pub fn mime_body<T>(self, body: T) -> Message<T>
Create message using mime body (MultiPart
or SinglePart
)
Shortcut for self.mime_1_0().join(body)
.
Trait Implementations§
Source§impl Clone for MessageBuilder
impl Clone for MessageBuilder
Source§fn clone(&self) -> MessageBuilder
fn clone(&self) -> MessageBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MessageBuilder
impl Debug for MessageBuilder
Auto Trait Implementations§
impl Freeze for MessageBuilder
impl !RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl !Sync for MessageBuilder
impl Unpin for MessageBuilder
impl !UnwindSafe for MessageBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more