问题
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