|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
from django.core import mail
|
|
|
|
|
from django.core.mail import EmailMessage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -13,8 +14,10 @@ def send(subject, content, sender, recipients, reply_to=None,
|
|
|
|
|
kwargs = {"reply_to": [reply_to]}
|
|
|
|
|
else:
|
|
|
|
|
kwargs = {}
|
|
|
|
|
with mail.get_connection() as connection:
|
|
|
|
|
for recipient in recipients:
|
|
|
|
|
email = EmailMessage(subject, content, sender, [recipient], **kwargs)
|
|
|
|
|
email = EmailMessage(subject, content, sender, [recipient],
|
|
|
|
|
connection=connection, **kwargs)
|
|
|
|
|
if attachments is not None:
|
|
|
|
|
for attach in attachments:
|
|
|
|
|
email.attach_file(attach)
|
|
|
|
|
|