Search code examples
pythonemailsmtptornado

Tornado non-blocking SMTP client


I'am looking for python async SMTP client to connect it with Torando IoLoop. I found only simple implmementation (http://tornadogists.org/907491/) but it's a blocking solution so it might bring performance issues.

Does anyone encountered non blocking SMTP client for Tornado? Some code snippet would be also very useful.


Solution

  • I wrote solution based on threads and queue. One thread per tornado process. This thread is a worker, gets email from queue and then send it via SMTP. You send emails from tornado application by adding it to queue. Simple and easy.

    Here is sample code on GitHub: link