Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Getting a list of header values Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
randy
Newbie
Newbie


Joined: 09 June 2006
Online Status: Offline
Posts: 1
Posted: 09 June 2006 at 12:39am | IP Logged Quote randy

I know I can use msg.GetHeader(header name) to get a value for a specific header entry. Is there a way to get a list of all the header names for a specific message (or to put it another way, a list of all the values I can pass to msg.getHeader)?

Thanks!
Back to Top View randy's Profile Search for other posts by randy
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 09 June 2006 at 7:37am | IP Logged Quote Alex

In MailBee Objects the developer can't get a list of all message headers, except that he
will parse message raw body manually. Nevertheless, MailBee.NET Objects has much greater functionality and flexibility.

In MailBee.NET Objects all message headers are stored in headers collection. Thus, the developer can iterate through collection to get all headers.

MailMessage msg = new MailMessage();
msg.LoadMessage(@"c:\test.eml");

// Iterate through headers collection
for (int i = 0; i < msg.Headers.Count; i++)
{
    Console.WriteLine(string.Format("{0} : {1}", msg.Headers[i].Name, msg.Headers[i].Value));
}

We provide 50% discount off MailBee.NET Objects price for all registered users of previous versions of MailBee products. If you interested in this, please contact us at support@afterlogic.com e-mail address.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide