Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to use a non-smtp backend #9

Open
tino opened this issue Mar 27, 2011 · 1 comment
Open

Impossible to use a non-smtp backend #9

tino opened this issue Mar 27, 2011 · 1 comment

Comments

@tino
Copy link

tino commented Mar 27, 2011

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...

@colinhowe
Copy link

I'm looking at how to do this. We're wanting to use Amazon SES so we cannot assume SMTP.

mjtorn pushed a commit to mjtorn/django-mailer-2 that referenced this issue Nov 17, 2014
…5dbf4d68c70af64738a5d

Enable headers param in send_html_email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants