| Author |  | 
      
        | sekhar.jaji Newbie
 
  
  
 Joined: 05 February 2007
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          I just downloaded .net objects and checked. Its working great.
           | Posted: 05 February 2007 at 9:23am | IP Logged |   |  
           | 
 |  
 Is there any way to retrieve custom headers from the mail other than manually parsing through the Message.RawHeader value?
 
 Here is the sample header of the mail that i want to retrieve different headers' information:
 
 Date: 14 Jul 2006 13:36:33 -0000
 Message-ID: <20060714133633.9748.xxxx@xx.xxxxx.com>
 Content-Type: multipart/alternative;
 boundary="----------=_1152884193-151 41-12271"
 Content-Transfer-Encoding: 8bit
 Mime-Version: 1.0
 From: =?ISO-2022-JP?B?Tm9ydGh3ZXN0IEFpcmxpbmVz?= <worldperks@asia.nwa.com>
 To: <Undisclosed Recipients>
 Subject:  =?ISO-2022-JP?B?Tm9ydGh3ZXN0IEFpcmxpbmVzIEUtZGlzY291bnQgQ2Ft cGFpZ24=?=
 X-Mailer: eXpresso ASP Delivery Engine
 X-Enckp: P514077135164625101476152274
 Reply-To: worldperks@asia.nwa.com
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | sekhar.jaji Newbie
 
  
  
 Joined: 05 February 2007
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          Actually i forgot to add the custom header in the sample. It is like this, along with other headers mentioned above:
           | Posted: 05 February 2007 at 9:29am | IP Logged |   |  
           | 
 |  
 X-Thor: a=123; b=234; asd=3242;
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          It's not necessary to parse Message.RawHeader value manually. MailBee.NET Objects does it automatically and puts all headers in MailMessage.Headers collection. You can get the value of X-Thor header as follows (in C# syntax):
           | Posted: 05 February 2007 at 9:54am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | MailMessage msg; 
 // Receive or load the message here.
 
 // Get the header value by its name.
 string headerValue = msg.Headers["X-Thor"];
 |  |  |  
 You can learn more how to operate with custom headers in descriptions of HeaderCollection and Header classes in MailBee.NET Objects documentation.
 
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  |