login/register

Snip!t from collection of Alan Dix

see all channels for Alan Dix

Snip
summary

Reading mail from Thunderbird
You'd think that reading mail in Thunderbird ought to be ...
First, there is no object which corresponds directly to ...

Programming
http://simon-cozens.org/programmer/articles/thunderbird-js.pod

Categories

/Channels/techie/thunderbird

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

Reading mail from Thunderbird

You'd think that reading mail in Thunderbird ought to be really easy - after all, Thunderbird's a mail client, that's what it's for. But I'm talking about reading mail from inside of Javascript - getting access to the body of a given message. This turns out to be a little more tricky.

First, there is no object which corresponds directly to a mail message. The best you've got is the nsIMsgDBHdr interface, which corresponds to an email's header plus a few more useful bits of metadata. From this you can find a mail's "key", which is the internal value that Thunderbird uses to identify it, its folder, and from thence you can read its body.

HTML

<h1><a class="u" href="#___top" title="click to go to top of document" name="Reading_mail_from_Thunderbird">Reading mail from Thunderbird</a></h1> <p>You'd think that reading mail in Thunderbird ought to be really easy - after all, Thunderbird's a mail client, that's what it's for. But I'm talking about reading mail from inside of Javascript - getting access to the body of a given message. This turns out to be a little more tricky.</p> <p>First, there is no object which corresponds directly to a mail message. The best you've got is the <code>nsIMsgDBHdr</code> interface, which corresponds to an email's header plus a few more useful bits of metadata. From this you can find a mail's "key", which is the internal value that Thunderbird uses to identify it, its folder, and from thence you can read its body.</p>