Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. from django.contrib.auth.models import User
  2. from django.core.mail import send_mail
  3.  
  4. recipients = User.objects.filter(is_staff=True)
  5. recipients = recipients.values_list('email', flat=True)
  6. send_mail('Subject here', 'Here is the message.', 'from@example.com', recipients, fail_silently=False)