diff --git a/README.md b/README.md index c0b8310..ea9e693 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ lettre = "0.10" ``` ```rust,no_run +use lettre::message::header::ContentType; use lettre::transport::smtp::authentication::Credentials; use lettre::{Message, SmtpTransport, Transport}; @@ -75,6 +76,7 @@ let email = Message::builder() .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy!")) .unwrap(); diff --git a/examples/asyncstd1_smtp_starttls.rs b/examples/asyncstd1_smtp_starttls.rs index d5dfc0b..e1679d6 100644 --- a/examples/asyncstd1_smtp_starttls.rs +++ b/examples/asyncstd1_smtp_starttls.rs @@ -1,6 +1,6 @@ use lettre::{ - transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncStd1Executor, - AsyncTransport, Message, + message::header::ContentType, transport::smtp::authentication::Credentials, AsyncSmtpTransport, + AsyncStd1Executor, AsyncTransport, Message, }; #[async_std::main] @@ -12,6 +12,7 @@ async fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new async year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy with async!")) .unwrap(); diff --git a/examples/asyncstd1_smtp_tls.rs b/examples/asyncstd1_smtp_tls.rs index 27889f0..c0299a0 100644 --- a/examples/asyncstd1_smtp_tls.rs +++ b/examples/asyncstd1_smtp_tls.rs @@ -1,6 +1,6 @@ use lettre::{ - transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncStd1Executor, - AsyncTransport, Message, + message::header::ContentType, transport::smtp::authentication::Credentials, AsyncSmtpTransport, + AsyncStd1Executor, AsyncTransport, Message, }; #[async_std::main] @@ -12,6 +12,7 @@ async fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new async year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy with async!")) .unwrap(); diff --git a/examples/smtp.rs b/examples/smtp.rs index 4261faf..5ebc153 100644 --- a/examples/smtp.rs +++ b/examples/smtp.rs @@ -1,4 +1,4 @@ -use lettre::{Message, SmtpTransport, Transport}; +use lettre::{message::header::ContentType, Message, SmtpTransport, Transport}; fn main() { tracing_subscriber::fmt::init(); @@ -8,6 +8,7 @@ fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy!")) .unwrap(); diff --git a/examples/smtp_selfsigned.rs b/examples/smtp_selfsigned.rs index 68d0a78..f45ec42 100644 --- a/examples/smtp_selfsigned.rs +++ b/examples/smtp_selfsigned.rs @@ -1,6 +1,7 @@ use std::fs; use lettre::{ + message::header::ContentType, transport::smtp::{ authentication::Credentials, client::{Certificate, Tls, TlsParameters}, @@ -16,6 +17,7 @@ fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy!")) .unwrap(); diff --git a/examples/smtp_starttls.rs b/examples/smtp_starttls.rs index 82d7b61..eb67005 100644 --- a/examples/smtp_starttls.rs +++ b/examples/smtp_starttls.rs @@ -1,4 +1,7 @@ -use lettre::{transport::smtp::authentication::Credentials, Message, SmtpTransport, Transport}; +use lettre::{ + message::header::ContentType, transport::smtp::authentication::Credentials, Message, + SmtpTransport, Transport, +}; fn main() { tracing_subscriber::fmt::init(); @@ -8,6 +11,7 @@ fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy!")) .unwrap(); diff --git a/examples/smtp_tls.rs b/examples/smtp_tls.rs index f5e5cba..90cb33d 100644 --- a/examples/smtp_tls.rs +++ b/examples/smtp_tls.rs @@ -1,4 +1,7 @@ -use lettre::{transport::smtp::authentication::Credentials, Message, SmtpTransport, Transport}; +use lettre::{ + message::header::ContentType, transport::smtp::authentication::Credentials, Message, + SmtpTransport, Transport, +}; fn main() { tracing_subscriber::fmt::init(); @@ -8,6 +11,7 @@ fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy!")) .unwrap(); diff --git a/examples/tokio1_smtp_starttls.rs b/examples/tokio1_smtp_starttls.rs index ea4023d..5c1b6ac 100644 --- a/examples/tokio1_smtp_starttls.rs +++ b/examples/tokio1_smtp_starttls.rs @@ -2,8 +2,8 @@ // since it uses Rust 2018 crate renaming to import tokio. // Won't be needed in user's code. use lettre::{ - transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message, - Tokio1Executor, + message::header::ContentType, transport::smtp::authentication::Credentials, AsyncSmtpTransport, + AsyncTransport, Message, Tokio1Executor, }; use tokio1_crate as tokio; @@ -16,6 +16,7 @@ async fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new async year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy with async!")) .unwrap(); diff --git a/examples/tokio1_smtp_tls.rs b/examples/tokio1_smtp_tls.rs index 94c439e..8329b34 100644 --- a/examples/tokio1_smtp_tls.rs +++ b/examples/tokio1_smtp_tls.rs @@ -2,8 +2,8 @@ // since it uses Rust 2018 crate renaming to import tokio. // Won't be needed in user's code. use lettre::{ - transport::smtp::authentication::Credentials, AsyncSmtpTransport, AsyncTransport, Message, - Tokio1Executor, + message::header::ContentType, transport::smtp::authentication::Credentials, AsyncSmtpTransport, + AsyncTransport, Message, Tokio1Executor, }; use tokio1_crate as tokio; @@ -16,6 +16,7 @@ async fn main() { .reply_to("Yuin ".parse().unwrap()) .to("Hei ".parse().unwrap()) .subject("Happy new async year") + .header(ContentType::TEXT_PLAIN) .body(String::from("Be happy with async!")) .unwrap();