[−][src]Struct sendgrid::Mail
This is a representation of a valid SendGrid message. It has support for all of the fields in the V2 API.
Fields
to: Vec<Destination<'a>>
cc: Vec<&'a str>
bcc: Vec<&'a str>
from: &'a str
subject: &'a str
html: &'a str
text: &'a str
from_name: &'a str
reply_to: &'a str
date: &'a str
attachments: HashMap<String, String>
content: HashMap<String, &'a str>
headers: HashMap<String, &'a str>
x_smtpapi: &'a str
Methods
impl<'a> Mail<'a>
[src]
pub fn new() -> Mail<'a>
[src]
Returns a new Mail struct to send with a client. All of the fields are initially empty.
pub fn add_cc(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_to(self, data: Destination<'a>) -> Mail<'a>
[src]
pub fn add_from(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_subject(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_html(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_text(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_bcc(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_from_name(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_reply_to(self, data: &'a str) -> Mail<'a>
[src]
pub fn add_date(self, data: &'a str) -> Mail<'a>
[src]
pub fn build(self) -> Mail<'a>
[src]
Convenience method when using Mail as a builder.
pub fn add_attachment<P: AsRef<Path>>(self, path: P) -> SendgridResult<Mail<'a>>
[src]
Add an attachment for the message. You can pass the name of a file as a path on the file system.
Examples
ⓘThis example is not tested
let message = Mail::new() .add_attachment("/path/to/file/contents.txt");
pub fn add_content(self, id: String, data: &'a str) -> Mail<'a>
[src]
pub fn add_header(self, id: String, data: &'a str) -> Mail<'a>
[src]
pub fn add_x_smtpapi(self, data: &'a str) -> Mail<'a>
[src]
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Mail<'a>
impl<'a> Send for Mail<'a>
impl<'a> Sync for Mail<'a>
impl<'a> Unpin for Mail<'a>
impl<'a> UnwindSafe for Mail<'a>
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, 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>,