Get Selected Message Data In Thunderbird Extension
I need to get some e-mail message data in my Thunderbird extension. I found this example on MDN (https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIMsgMessageSer
Solution 1:
This documentation looks fairly outdated. I would suggest:
- using
gFolderDisplay.selectedMessage
(try typingtop.opener.gFolderDisplay.selectedMessage
in the Error Console), - reading some recent code that uses
Services
andMailServices
so as to simplify your code.
That being said, I don't know what you're trying to achieve but:
- you'd certainly be better off using a wrapper such as
MsgHdrToMimeMessage
(self-reference: http://blog.xulforum.org/index.php?post/2011/01/03/An-overview-of-Thunderbird-Conversations) - if you absolutely, absolutely need to get the raw contents of the message, http://mxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/mimemsg.js#223 has an example on how to do that (it's the implementation of the said MsgHdrToMimeMessage; by simplifying it, you should be able to get directly the raw data of the message).
Good luck with that, once you get a working sample, please add it to the MDN wiki!
Cheers,
jonathan
Post a Comment for "Get Selected Message Data In Thunderbird Extension"