Replace hyperx ContentType header with our own implementation (#598)

* Replace hyperx ContentType header with our own implementation

* Let's not forget ContentTypeErr

* Adress code review comment
This commit is contained in:
Paolo Barbolini
2021-04-08 10:40:07 +02:00
committed by GitHub
parent acc4ff4898
commit 486e0f9d50
7 changed files with 187 additions and 87 deletions

View File

@@ -29,16 +29,12 @@ fn main() {
MultiPart::alternative() // This is composed of two parts.
.singlepart(
SinglePart::builder()
.header(header::ContentType(
"text/plain; charset=utf8".parse().unwrap(),
))
.header(header::ContentType::TEXT_PLAIN)
.body(String::from("Hello from Lettre! A mailer library for Rust")), // Every message should have a plain text fallback.
)
.singlepart(
SinglePart::builder()
.header(header::ContentType(
"text/html; charset=utf8".parse().unwrap(),
))
.header(header::ContentType::TEXT_HTML)
.body(String::from(html)),
),
)