How to save image attachment from email using IMAP

2019-07-29 14:52发布

I've successfully written script that connects to my mail server and retrieves the headers and bodies of all new messages. I want to take it one step further to detect if attachment exists (images only), if so, download to server.

How to go about this using PHP & IMAP?

Thanks in advance

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-29 15:13

Attachments would be MIME encoded - it's fairly simple to parse and check the contents.

Images would have an image MIME content type.

查看更多
登录 后发表回答