电子邮件中的西班牙语字符在邮件客户端中显示为问号

发布于 2024-10-17 10:46:05 字数 529 浏览 1 评论 0原文

我正在使用 php 中已经编写的 Mail 类。电子邮件大多用西班牙语发送。以下是传递给 php 邮件函数的标头 -

MIME-Version: 1.0
Content-Type: multipart/mixed;

另外附加标头也被附加到消息中(不知道它的作用),

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

电子邮件在浏览器中正确显示,但在邮件客户端中,重音字符被问号替换,

例如:

Una nueva contraseña se solicito 

似乎

Una nueva contrase�a se solicito

已在 Thunderbird 和 Outlook 中检查了此问题

如何修复此问题以在邮件客户端中也正确显示这些字符

I am using an already written Mail class in php. Emails are mostly sent in spanish language. Following are the headers being passed to the php mail function -

MIME-Version: 1.0
Content-Type: multipart/mixed;

Also additional headers are being appended to the message (don't know what it does),

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Emails appear properly in browsers but in mail clients, accented characters are replaced by question marks

for eg:

Una nueva contraseña se solicito 

appears

Una nueva contrase�a se solicito

have checked this in Thunderbird and outlook

How do I fix this to show these characters correctly in mail clients as well

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情魔剑神 2024-10-24 10:46:05

我想您还必须将 Thunderbird 和 Outlook 中的字符集更改为 UTF-8。

I guess you have to change the character set to UTF-8 in Thunderbird and Outlook as well.

晚风撩人 2024-10-24 10:46:05

电子邮件可能以 UTF-8 以外的格式发送。确保在将文本传递给类之前将其转换为 UTF-8(或在类中将其转换为 UTF-8)。

The email is probably being sent out as something other than UTF-8. Make sure to convert the text to UTF-8 before passing it to the class (or convert it to UTF-8 in the class).

装迷糊 2024-10-24 10:46:05

就像 Raffael 所说,客户端也必须采用 UTF-8 格式,更好的解决方案是在发送邮件之前传递 htmlentities 并将邮件显示为 HTML

Like Raffael say the client have to be in UTF-8 too, the better solution is to pass with htmlentities before sending the mail and display the mail as HTML

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文