[−][src]Struct mailjet_rs::v3::Email
Mailjet's SendAPI V3 Email
Recipients listed in To
will receive a common
message showing every other recipients and carbon copies recipients.
When using To, Cc and Bcc instead of Recipients, the email addresses need to be presented as SMTP headers in a string and not as an array.
Note: If a recipient does not exist in any of your contact list it will be created from scratch, keep that in mind if you are planning on sending a welcome email and then you're trying to add the email to a list as the contact effectively exists already.
Example
ⓘThis example is not tested
use mailjet_rs::common::Recipient; use mailjet_rs::v3::Email; use mailjet_rs::{Client, SendAPIVersion}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { let client = Client::new( SendAPIVersion::V3, "public_key", "private_key", ); let to = vec![Recipient::new("foo@bar.com")]; let cc = vec![Recipient::new("bar@baz.com"), Recipient::new("boo@baz.com")]; let bcc = vec![Recipient::new("bar_baz_box@mail.com")]; let message = Email::new( "your.mailjet.email@yourcompany.com", "Sender Name", "Subject", "Email Content", Some(String::from("<h1>HTML Content for Email</h1>")), to, Some(cc), Some(bcc) ); client.send(message).await; Ok(()) }
Fields
from_email: String
The verified sender email address
from_name: String
The name of the sender
subject: Option<String>
The subject of the email
text_part: String
The raw text content of the email
html_part: Option<String>
The HTML content of the email
to: Vec<Recipient>
cc: Option<Vec<Recipient>>
bcc: Option<Vec<Recipient>>
Implementations
impl Email
[src]
pub fn new(
from_email: &str,
from_name: &str,
subject: Option<String>,
text_part: &str,
html_part: Option<String>,
to: Vec<Recipient>,
cc: Option<Vec<Recipient>>,
bcc: Option<Vec<Recipient>>
) -> Self
[src]
from_email: &str,
from_name: &str,
subject: Option<String>,
text_part: &str,
html_part: Option<String>,
to: Vec<Recipient>,
cc: Option<Vec<Recipient>>,
bcc: Option<Vec<Recipient>>
) -> Self
Trait Implementations
impl Debug for Email
[src]
impl<'de> Deserialize<'de> for Email
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Payload for Email
[src]
impl Serialize for Email
[src]
Auto Trait Implementations
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnwindSafe for Email
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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>,