What I do now with Outlook:
I receive email orders for products. I select a single or multiple emails in Outlook (a single order can have multiple emails associated with it) and then switch to my Delphi coded OrderManager program and click "Import". It uses Outlook's COM automation interface to read the text of each message, parses and processes each one.
The question is, can I do this using Thunderbird instead? Does Thunderbird have a COM interface? I must be googling the wrong keywords because I haven't found anything yet.
Btw, I do have a version of my OrderManager that just reads the emails directly from my email server using Indy, but for several reasons I'd like to try to read them from Firefox.
Any suggestions, links to docs, or code samples will be greatly appreciated!
Check this link out.
You could write a C or C++ wrapper around XPCOM and then use that wrapper within Delphi.
There is also an open source XPCOM wrapper written in Delphi. You might want to check that out as well. Thanks Stijn for pointing that out.
Hope it helps.
You could also parse Thunderbird's mailbox files yourself.
%APPDATA%\Thunderbird\profiles.ini
, read where the profile folder is located (if there's more than one profile, look through sections Profile
0..Profile
n for the one that has the value Default=1
)Mail
and/or ImapMail
subfolders of the profile folder represents an account (Mail
contains POP accounts, ImapMail
contains IMAP accounts);From
' indicates a new message. Use the X-Mozilla-Status
header to figure out whether the message is still valid, or whether it's been marked for deletion. (You can use the CDO.Message
COM object to parse the message for you, if you want).You should recurse for each subfolder ending on '.sbd', since that will contain that mailbox's subfolders (E.g. Inbox.sbd
will contain the mail folders under the Inbox).
Be wary of file locking issues, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With