You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of django's other backends than the smtp backend can be used, as for example the console backend. This because django-mailer-2 uses the connection attribute of the backend directly, and those backends have no such attribute.
I tryed fixing this by checking for this attribute like-so:
if hasattr(smtp_connection, 'connection'):
smtp_connection.connection.sendmail(message.from_address,
[message.to_address],
message.encoded_message)
else:
smtp_connection.send_messages([message])
But that doesn't work because the send_messages method expects a django.core.mail.messages.EmailMessage instance, instead of the django_mailer.models.EmailMessage that is passed. And calling the backend 'smtp_connection' what is not is strange as well.
How to solve this? As it is quite nice to be able to test mail sending in development...
The text was updated successfully, but these errors were encountered:
None of django's other backends than the smtp backend can be used, as for example the console backend. This because django-mailer-2 uses the connection attribute of the backend directly, and those backends have no such attribute.
I tryed fixing this by checking for this attribute like-so:
But that doesn't work because the send_messages method expects a django.core.mail.messages.EmailMessage instance, instead of the django_mailer.models.EmailMessage that is passed. And calling the backend 'smtp_connection' what is not is strange as well.
How to solve this? As it is quite nice to be able to test mail sending in development...
The text was updated successfully, but these errors were encountered: