1

I wanted to create a simple interface to send massive mails for a django project (Gitorious, GitHub) but I don't know how to start (models, forms, views, etc.).

I looked at django-mailer but it doesn't suit my needs, also I dind't find another mailer application for django that was this complete. Any documentation, advices, or app recommendatios are very welcome.

CastleDweller
  • 8,204
  • 13
  • 49
  • 69
  • Agree with Tomasz (+1), that you shouldn't use smtplib directly, but at the very least route emails through postfix to smtp. Django-mailer seems very good; but you have to list why it doesn't suit your needs. Maybe fork django-mailer and get it to suit your needs? If you don't know how to start with django, then go to http://www.djangoproject.com – dr jimbob Jun 07 '11 at 21:23

2 Answers2

4

Everything you write will be unreliable comparing to e.g. Postfix (bounces, failures, servers down etc). Therefore, as a minimal setup, I suggest to point Django SMTP config variables to the local Postfix instance and configure Postfix to relay emails through the email account you would otherwise use directly. Then you can just use standard django machinery and enjoy the peace of mind.

Tomasz Zieliński
  • 16,136
  • 7
  • 59
  • 83
  • I updated the question. Apparently I expressed myself really bad, sorry. I actually don't want to make a sendmail/postfix app but a interface to send mails from django, while smtplib does the work through django wrappers. – CastleDweller Jun 07 '11 at 14:42
  • @Oscar: So I still don't quite understand what you want to do. Why django-maile doesn't suit your needs, why SMTPlib is not enough etc ? – Tomasz Zieliński Jun 07 '11 at 20:45
  • @Tomasz I'm sorry, it seems that I'm not able to make the question properly, my fault. I want to do a django app to send emails to lots of users through send_mass_mail() django wrapper, but I don't know which things I have to define in the application models, forms, etc. to make it work in the Django admin. – CastleDweller Jun 07 '11 at 21:28
  • @Oscar: I don't know either - it's too vague to answer. If you want to be able to pick users in admin and then send them some standarized email, then you can write a custom admin action: https://docs.djangoproject.com/en/1.3/ref/contrib/admin/actions/. Still, there is nothing that prevents you to put Postfix along with `send_mass_mail()` - in mass mailing you definitely want to handle failures, bounces etc. which is something that Postfix provides. Last but not least, maybe you just need something like Mailchimp.com ? – Tomasz Zieliński Jun 07 '11 at 21:56
  • I've read the admin actions, that's what I meant with the question (still, seems that I couldn't get the point of it) Thanks, I'm giving the answer as valid (and +1 for taking the time hehe) – CastleDweller Jun 08 '11 at 00:23
  • @Oscar: No worries, that's what StackOverflow is meant for :-) – Tomasz Zieliński Jun 08 '11 at 11:03
0

On a linux system you could use sendmail: http://www.yak.net/fqa/84.html or use the smtp lib: http://docs.python.org/library/smtplib.html .

pharno
  • 46
  • 2
  • 7
  • I was more looking forwards to a structure of the django app, since django has its own wrappers for smtplib, but thanks for the advice :) – CastleDweller Jun 07 '11 at 09:33