1

I have a Django project that needs to send out around 600 emails. I have Celery set up and it works, for the most part. I have the Django project set up to use my Google Apps (Business version -- ie: paid for) email account as the sending account. For testing purposes, I have every email sent to me -- not to the client.

The issue I am having is that Celery seems to randomly skip people in the list. When I start the process of sending all 600 emails, Celery works away, sending emails (I can see them show up in my inbox) but I only receive a total of about 420 emails. When Celery finishes, there are still 180 or so people that need the email. If I click "send emails" again with ONLY the remaining 180 people, it will finish the job and, at the end of two attempts, will have sent emails to all 600 people.

Why would Celery be skipping people?

Garfonzo
  • 3,876
  • 6
  • 43
  • 78
  • Please share the code you are using so we can help diagnose the issue. – apiguy Jan 12 '12 at 06:44
  • @free-dom: I think I may have figured out the issue, but am still working on pin-pointing it. I believe the issue is that I am trying to send too many emails, too quickly through Gmail (Google Apps). As a result, Gmail, at some point, complains and stops accepting new send requests (or something like that). I am going to try and configure Celery to limit how many emails it sends per minute, so that Gmail doesn't freak out. How to accomplish this limiting is what I'm working on. – Garfonzo Jan 12 '12 at 06:51

1 Answers1

3

Yes, you will get those gmail errors and it's not particularly predictable.

You could just use django-mailer instead -- I do, and deal with those gmail connection errors by letting django-mailer automatically retry the failed sending attempts until they succeed.

Check out this SO question for more folks suggesting you just use django-mailer vs celery for mail. Advice on Python/Django and message queues

Community
  • 1
  • 1
Yuji 'Tomita' Tomita
  • 115,817
  • 29
  • 282
  • 245