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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,638
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
Highlighted
BlackBerry Development Advisor
Posts: 143
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.

 

Developer
Posts: 1,638
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.

BlackBerry Development Advisor
Posts: 143
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.