How to get the emails headers from aspose.network.imap?

Hi,

I'am using the aspose.network.imap calss to fetch the mails from gmails inabox. here i want to get the email headers from the fetchmessege method. here it is having Headers property.

Please tell me how we can use this headers property to get all the header information?

thanks...

Hi,


Thank you for inquiry.

You may get the headers information as below:

MailMessage msg = client.FetchMessage(msgInfo.SequenceNumber);
for (int i=0 ; i<msg.Headers.Count ; i++)
{
Console.WriteLine(msg.Headers.Keys[i] + ": " + msg.Headers.Get(i));
}