Indy9 Get Raw Email header?

685 views Asked by At

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?

2

There are 2 answers

0
Jessica Brown On BEST ANSWER

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

1
Remy Lebeau On

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

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