send_ticketdata: update lettre usage

* update Cargo.toml to new lettre crate (v0.10.0-rc.3)
* use TEXT_PLAIN method

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2021-06-11 12:56:51 +02:00
parent e06545aa92
commit 5a21958325
2 changed files with 3 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ clap = { version = "~2.33", features = ["suggestions", "color"] }
csv = { version = "~1.1" }
dotenv = { version = "~0.15.0" }
envy = { version = "~0.4" }
lettre ={ version = "0.10.0-beta.1" }
lettre ={ version = "0.10.0-rc.3" }
lazy_static = { version = "~1.4.0" }
log = { version = "~0.4.8" }
maud = { version = "~0.22.1" }

View File

@@ -76,16 +76,12 @@ pub fn sendticketdata(email: &Email, lang: &Lang) -> Result<(), Box<dyn Error>>
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(ascii_body)),
)
.singlepart(
SinglePart::builder()
.header(header::ContentType(
"text/html; charset=utf8".parse().unwrap(),
))
.header(header::ContentType::TEXT_PLAIN)
.body(html.into_string()),
),
)