View Code? Open in Web Editor
NEW
Django MailerSend makes it easier to send emails in Django apps using the MailerSend API.
Home Page: https://pypi.org/project/django-mailersend/
License: MIT License
django-mailersend's People
Contributors
Stargazers
Watchers
django-mailersend's Issues
When attaching a MIMEImage, sending fails
Test case:
from django .core .mail .message import EmailMessage
from email .mime .image import MIMEImage
with open ('some-image.jpg' , 'rb' ) as fp :
data = fp .read ()
mime_img = MIMEImage (data )
email_message = EmailMessage (to = ['[email protected] ' ], subject = 'Test' , body = 'Body' )
email_message .attach (mime_img )
email_message .send ()
According to the Django documentation , send_messages()
should return the number of sent messagesage. This will then also be used to return an bool from e.g. django.core.mail.send_mail
indicating whether the message was sent or not. As it is, it'll just return None with this backend.
E.g.
This is perfectly okay according to RFC 5322 (page 45) or section 3.4 but mailersend will respond with
HTTP 422 {"message":"The from.email must be a valid email address.","errors":{"from.email":["The from.email must be a valid email address."]}}
The sent payload contains {'email': 'Test sender <[email protected] >'}
while it should probably be parsed and split into