dpw70180 2014-02-21 14:20
浏览 114
已采纳

IMAP-从退回的邮件中解析原始标题

I am sending hundreds of emails with an unique id through email header. I have to track the bounced mails for the particular unique id.

I can see the bounced emails with an attached EML file in my mailbox. Unfortunately the unique ID which I am looking for is placed in the attached EML file's header instead of bounced email's header.

I am using PHP's IMAP function to read the headers and body sections. But unable to read EML attachment.

Could any one explain how to read or parse the EML attachment using IMAP function.

Thanks.

  • 写回答

1条回答 默认 最新

  • dry69034 2014-02-21 18:21
    关注

    The .eml is most properly described as a message/rfc822 bodypart; it comprises one part of a multipart/report.

    In IMAP each bodypart has its own part number, and you can access headers and individual fields by supplying the number. In many bounces, the number of the message/rfc822 is 3, and you can access e.g. the subject using f uid fetch 123456 body.peek[3.1.header.fields (subject)]. The server will do the parsing you want and give you back the subject field.

    The usual way to get the part number is to use bodystructure.

    Expressing this using PHP is left as an exercise for the reader. Good luck.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥15 C# datagridview 栏位进度