开发者

Can you determine if an email has attachments from just the email header

Can you determine if an email has attachments from just the email header.

If I call the Pop3 command "TOP 1 0" can I determine from the data returned if message has attachments.

If not is there anyway of find this out with downloa开发者_C百科ding the whole message and counting the attachments.


POP3 does not provide attachment information in the header so no, unfortunately, I'm pretty sure you have to read and parse the entire message.

In any cases, not all POP3 servers provide the TOP command.


Does that command give you the full headers of each message? If so, you could rule out messages without attachments by reading the Content-Type. If it's not a multipart message then it doesn't have an attachment. However, I do not believe you can prove that a message does have an attachment without downloading the contents of the message.


If content type is "multipart/mixed" then there is an attachment in the Email.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜