1

Is there a way to send a mail using django-mailer instantly?

As I see it now, send_mail() of django-mailer puts the mail on the queue and I need to run a periodic task that runs after every X minutes to send all mails in the queue.

I have a small app that needs to send only a handful of emails, and I want to send the email as soon as I have to, but in a different worker thread (to not hold up the web thread), and hence trying to use django-mailer

Thanks

dowjones123
  • 3,695
  • 5
  • 40
  • 83
  • Then why use django-mailer at all ? Just do `send_mail` provided by django. – karthikr Dec 02 '14 at 15:04
  • @karthikr send_mail() does not send emails in a separate worker thread, unless I am mistaken – dowjones123 Dec 02 '14 at 16:53
  • well, if you were to remove the queued functionality of django-mailer, it is the exact same thing as `send_mail` – karthikr Dec 02 '14 at 16:54
  • I meant, I could have a Celery @shared_task say myfunc() which accepts all arguments of send_mail (from, to , msg), and call send_mail() in that shared_task. And I can call myfunc.delay() to have the mail being sent in a different thread (but instantly, not at some next periodic time). I was looking for a package does this – dowjones123 Dec 02 '14 at 17:10

0 Answers0