简体   繁体   English

IMAP电子邮件编码问题

[英]IMAP E-mail encoding issue

I'm trying to parse e-mails with IMAP, i'm getting messages with imap_fetchbody($conn, $i, 1) which gives me: 我正在尝试使用IMAP解析电子邮件,我正在使用imap_fetchbody($conn, $i, 1)获取消息,这给了我:

string(566) "
The email message addressed to "hidden=2Esomething@site=2E=
net" with the subject "subject" has been successfully delivered to =
the destination at 12-Oct-2013 11:01 UTC=2E=20

This is an automated response=2E Please do not reply to this message=2E   Thank you=2E"

Now in above example, the =2E should be a . 现在在上面的示例中, =2E应该是a . The header says the charset is Windows-1252 . 标头显示字符集为Windows-1252

I've tried iconv and mb_convert_encoding but both fail to resolve this. 我已经尝试过iconvmb_convert_encoding但是都无法解决这个问题。 Viewing the e-mail in the webmail client (roundcube) shows it as it should, but I can't seem to convert it properly. 在webmail客户端(roundcube)中查看电子邮件会按应有的方式显示它,但是我似乎无法正确转换它。

Any suggestions ? 有什么建议么 ?

As I was continuing to search, i found quoted_printable_decode in a comment at PHP.net / imap_fetchbody which solves the problem. 当我继续搜索时,我在PHP.net / imap_fetchbody的注释中找到quoted_printable_decode ,此问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM