Mail not sent when SendEmail returns success?

Looks to me like sendmail is returning true before the message has been sent but I’m sure you’ll tell me that there is no way this can happen…

The SendEmail method returned true after the email was successfully handed over to the SMTP server. When the SMTP server decides to actually forward the email onward to its destination is another matter. Some SMTP servers wait until the SMTP client’s connection is terminated. Calling mailman.CloseSmtpConnection will do it.

Tags :