fix(email): use proper MIME encoding for UTF-8 responses
Replace bare .body() call with .singlepart(SinglePart::plain()) to ensure outgoing emails have explicit Content-Type: text/plain; charset=utf-8 header. This fixes recipients seeing raw quoted-printable encoding (e.g., =E2=80=99) instead of properly decoded UTF-8 characters.
This commit is contained in:
parent
ab2cd51748
commit
3d3d471cd5
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
use lettre::message::SinglePart;
|
||||||
use lettre::transport::smtp::authentication::Credentials;
|
use lettre::transport::smtp::authentication::Credentials;
|
||||||
use lettre::{Message, SmtpTransport, Transport};
|
use lettre::{Message, SmtpTransport, Transport};
|
||||||
use mail_parser::{MessageParser, MimeHeaders};
|
use mail_parser::{MessageParser, MimeHeaders};
|
||||||
|
|
@ -389,7 +390,7 @@ impl Channel for EmailChannel {
|
||||||
.from(self.config.from_address.parse()?)
|
.from(self.config.from_address.parse()?)
|
||||||
.to(recipient.parse()?)
|
.to(recipient.parse()?)
|
||||||
.subject(subject)
|
.subject(subject)
|
||||||
.body(body.to_string())?;
|
.singlepart(SinglePart::plain(body.to_string()))?;
|
||||||
|
|
||||||
let transport = self.create_smtp_transport()?;
|
let transport = self.create_smtp_transport()?;
|
||||||
transport.send(&email)?;
|
transport.send(&email)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue