Indy9 Get Raw Email header?

你。 提交于 2019-12-13 21:35:46

问题


Does Indy9 have any way to get a specific raw email header (say, "Subject" or "From") which still includes the transfer-encoding (ie: has not been mangled by DecodeHeader on older versions of Delphi with poor Unicode support), or would I have to parse the entire email header manually to extract this information?


回答1:


The TIdMessage.RawHeaders property is what you are looking for, eg:

Subject := IdMessage1.RawHeaders.Values['Subject'];



回答2:


I have solved the problem, calling IdMessage1.Headers.Values['Subject'] BEFORE calling IdMessage1.ProcessHeaders gives different results than after.



来源:https://stackoverflow.com/questions/8958055/indy9-get-raw-email-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!