Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
smiley
Posts: 1,419
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido
Accepted Solution

How can I read the email message headers?

[ Edited ]

I'm using the Message class to get a email message and I want to read the message header.  I do not see any function to get the message header in the Message class.  A typical header looks like this

 

Received: (qmail 9904 invoked by uid 4121); 14 Nov 2013 15:32:41 -0000
Delivered-To: hello_there@yahoo.com
Message-ID: <F0D8FA6E.2DA0AC34@yahoo.com>
X-Priority: 3
X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
Received: (qmail 9901 invoked from network); 14 Nov 2013 15:32:41 -0000
Please use plain text.
BlackBerry Development Advisor
RSperanza
Posts: 141
Registered: ‎03-08-2012
My Device: Z10
My Carrier: Bell

Re: How can I read the email message headers?

Hi.

 

All of the important header properties, such as the ones you pasted into your post, are exposed as properties of the Message class documented here:

 

https://developer.blackberry.com/native/reference/cascades/bb__pim__message__message.html

 

For example, X-Priority's value is returned via the priority() mthod in the Message class.

 

Read the online reference and try printing some of those properties via debug statements and determine if you can retrieve everything you need.  If something is missing. feel free to reply back to inquire further or file a feature request in the Developer Issue Tracker so that we can forward it to product management for review.

 

Please use plain text.
Developer
smiley
Posts: 1,419
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How can I read the email message headers?

thanks.  I have read that before I posted the message.

There are other headers that i'm interested in that the Message class can not get like X-Mailer .

 

Would be nice is Message class returns the entire message header block.

Please use plain text.
BlackBerry Development Advisor
RSperanza
Posts: 141
Registered: ‎03-08-2012
My Device: Z10
My Carrier: Bell

Re: How can I read the email message headers?

I will log a feature request for a method to retrieve the message Headers as a QMap for product management to review.  It may take a while before it becomes available so you may need to work around the missing information for now.

Please use plain text.