views:

87

answers:

2

Why does Thunderbird always return immediately after sending mail through MAPI?

Other clients, like Outlook Express, returns only when the mail is sent or when the user was cancelled the request. But Thunderbird always return SUCCESS every time.

Somebody knows why or knows how to fix it?

Thanks in advance.

A: 

Not all email clients behave the same. The specific behavior does not need to comply (AFAIK) to any standard. My copy of Thunderbird, by the way, first sends the file, and I can see the "sent" progress line while it does so.

However, Microsoft Outlook may consider a mail as "sent" when it is placed into the "Outgoing" folder (I last checked in the beginning of the 2000s... so maybe has changed).

Depending on the actual requirements of your application, you may want to consider to log the message ID or handle when sending it, and then track it inside Thunderbird (programmatically) to locate whether it has moved into the "Sent" folder.

Etamar L.
Ok. I need know this because I send a mail from my application referencing some temporary files whose I need to delete after sending. But how the function returns imediately the message could not be already sent, then I need to not delete the temporary files.
Douglas Lise
In that case, I think you should be safe when you receive the OK notice from the Email client application. This is because it does not use the attached files _while_ sending the email, just when transforming them into an attached stream. Check this, you might be surprised. But this is a new question ;-)
Etamar L.
I tested and it only has a reference to file (FileName Only), importing it to the message only at the effective sending moment (after return to my app).
Douglas Lise
A: 

Here is another try at your problem. The Activity Manager documented on Mozilla's Thunderbird API documentation webpage, is a new component available from version 3.

Among other things, it listens to events, and tells you when something has occured, and its progress. They have an example for sending mail.

Hope this helps.

Etamar L.
Most of my users uses the thunderbird version 2. But thanks by the answer.
Douglas Lise
Well, tried my best. An hour for nothing...
Etamar L.