Skip to content

Commit

Permalink
Use correct MIME type in SMTP
Browse files Browse the repository at this point in the history
  • Loading branch information
GamePad64 committed Dec 15, 2024
1 parent d2b6e7c commit 79a1b97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions transports/notifico-smtp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ impl EmailTransport {
for mut attachment in attachments_inline {
let cid = attachment.plugin_values.get("email.cid").unwrap().clone();

let content_type =
ContentType::parse(mime::APPLICATION_OCTET_STREAM.as_ref()).unwrap();
let content_type = ContentType::parse(attachment.mime_type.as_ref()).unwrap();
let attach =
Attachment::new_inline(cid).body(attachment.content().await?, content_type);
mp_related = mp_related.singlepart(attach);
Expand All @@ -176,7 +175,7 @@ impl EmailTransport {
}

for mut attachment in attachments_mixed {
let content_type = ContentType::parse(mime::APPLICATION_OCTET_STREAM.as_ref()).unwrap();
let content_type = ContentType::parse(attachment.mime_type.as_ref()).unwrap();
let attach = Attachment::new(attachment.file_name.clone())
.body(attachment.content().await?, content_type);
mp_mixed = mp_mixed.singlepart(attach)
Expand Down

0 comments on commit 79a1b97

Please sign in to comment.