电子邮件中的西班牙语字符在邮件客户端中显示为问号
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想您还必须将 Thunderbird 和 Outlook 中的字符集更改为 UTF-8。
I guess you have to change the character set to UTF-8 in Thunderbird and Outlook as well.
电子邮件可能以 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).
就像 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