[Answered ]-What is correct way to send mail asynchronously in python/django?

2๐Ÿ‘

โœ…

If you want something asynchronous, integrated in Django, you need an asynchronous task queue/job. Even more if you have to send a lot of mail, it will block the Django flow.

Task queues manage background work that must be executed outside the
usual HTTP request-response cycle.

Tasks are handled asynchronously either because they are not initiated
by an HTTP request or because they are long-running jobs that would
dramatically reduce the performance of an HTTP response.

There are several task queue system that integrate well with Django like Celery (docs). I recommend you to read this to understand and choose the right solution : Full Stack Python โ€“ Task queues

Leave a comment