PHP imap problems

后端 未结 1 2035
星月不相逢
星月不相逢 2020-12-12 08:23

I need to be able to use my gmail from a php script. But whatever I try, the message body comes out all crappy with characters like =3D and random equals signs. Sometimes it

相关标签:
1条回答
  • 2020-12-12 09:03

    You're assuming your mail message is always at position 2.2? There's absolutely no guarantees... depends on what message is sent you plan text (just one body), html/text (two), with attachment (three plus) in reply to another email (then the other email will be a body with it's own sub bodies).

    The =3D (quoted printable) and base64 data are because of message body encodings. Have a look at imap_fetchstructure which explains how many parts their are on a message (you can search through it to find text), and review the ->type component of each body to learn about it's encoding (type=4 is quoted printable, type=3 is base64)

    0 讨论(0)
提交回复
热议问题