new emails for wtem results
[edumed.git] / wtem / management / commands / __init__.py
1 from django.core.mail import EmailMessage
2 from django.conf import settings
3
4 def send_mail(subject, body, to):
5     if not isinstance(to, list):
6         to = [to]
7
8     reply_to = getattr(settings, 'WTEM_REPLY_TO', None)
9     headers = dict()
10     if reply_to:
11         headers['Reply-To'] = reply_to
12
13     email = EmailMessage(subject, body,
14         getattr(settings, 'WTEM_FROM', 'edukacjamedialna@nowoczesnapolska.org.pl'),
15         to, headers = headers)
16     #print email.message()
17     email.send(fail_silently = False)