1 from django.core.mail import EmailMessage
 
   2 from django.conf import settings
 
   5 def send_mail(subject, body, to):
 
   6     if not isinstance(to, list):
 
   9     reply_to = getattr(settings, 'WTEM_REPLY_TO', None)
 
  12         headers['Reply-To'] = reply_to
 
  14     email = EmailMessage(subject, body,
 
  15         getattr(settings, 'WTEM_FROM', 'olimpiada@nowoczesnapolska.org.pl'),
 
  16         to, headers = headers)
 
  17     #print email.message()
 
  18     email.send(fail_silently = False)