Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Retrieve custom headers Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sekhar.jaji
Newbie
Newbie
Avatar

Joined: 05 February 2007
Location: India
Online Status: Offline
Posts: 3
Posted: 05 February 2007 at 9:23am | IP Logged Quote sekhar.jaji

I just downloaded .net objects and checked. Its working great.

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 View sekhar.jaji's Profile Search for other posts by sekhar.jaji
 
sekhar.jaji
Newbie
Newbie
Avatar

Joined: 05 February 2007
Location: India
Online Status: Offline
Posts: 3
Posted: 05 February 2007 at 9:29am | IP Logged Quote sekhar.jaji

Actually i forgot to add the custom header in the sample. It is like this, along with other headers mentioned above:

X-Thor: a=123; b=234; asd=3242;
Back to Top View sekhar.jaji's Profile Search for other posts by sekhar.jaji
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 05 February 2007 at 9:54am | IP Logged Quote Andrew

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):

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 View Andrew's Profile Search for other posts by Andrew
 

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