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

Error after installing updated sendgrid-django package #34

Open
cesarmarroquin opened this issue Nov 18, 2016 · 4 comments
Open

Error after installing updated sendgrid-django package #34

cesarmarroquin opened this issue Nov 18, 2016 · 4 comments
Assignees
Labels

Comments

@cesarmarroquin
Copy link

I am getting an issue on my python 3.5 and Django 1.10 project. I uninstalled sendgrid and sendgrid-django from my list of packages, and then reinstalled sendgrid-django and I now get a HTTP Error 400: Bad Request error when I try to send mail.

When i check my packages it shows that sendgrid is now 3.6.3 and sendgrid-django is 4.0.1. Sendgrid used to be 1.4.0 and sendgrid-django was 2.0.0 It was working before I installed the new updated versions.

My code is this below
mail = EmailMultiAlternatives( subject="Your Subject", body="a new application was created!", from_email="[email protected] <[email protected]>", to=["[email protected]"], headers={"Reply-To": "[email protected]"} ) mail.send()

Ive been trying to figure out but cant see what is causing the error. I even went as far as clearing my virtual enviroment locally, and reinstalling my packages and that didnt work.

@andriisoldatenko
Copy link
Collaborator

andriisoldatenko commented Nov 19, 2016

@cesarmarroquin
just tested on my project, everything is working:

(example.com) vagrant@vagrant-ubuntu-trusty-64:$ python -V
Python 3.5.2
(example.com) vagrant@vagrant-ubuntu-trusty-64:$ pip freeze | grep sendgrid
sendgrid==3.6.3
sendgrid-django==4.0.1

(example.com) vagrant@vagrant-ubuntu-trusty-64:$ pip freeze | grep Django
Django==1.10.2
[19/Nov/2016 06:41:01] INFO {'body': 'test', 'cc': [], 'reply_to': [], 'alternatives': [('example', 'text/html')], 'extra_headers': {}, 'template_id': 'fb4213ae-3c46-44e0-afc4-c5d63e03abfa', 'to': ['[email protected]'], 'from_email': '[email protected]', 'connection': <sgbackend.mail.SendGridBackend object at 0x7fe225c1f3c8>, 'subject': 'Example mail subject', 'bcc': [], 'attachments': [], 'substitutions': {'%code%': '860880'}}

@elbuo8
Copy link
Owner

elbuo8 commented Nov 19, 2016

@cesarmarroquin can you share the actual body of the error you are seeing?

@zlebnik
Copy link

zlebnik commented Dec 12, 2016

Got same error, looks like Reply-To header leads to error:

{"errors":[{
"message":"Header can not be one of the reserved keys. Refer to documentation link.",
"field":"headers.Reply-To",
"help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.headers"}
]}

@andriisoldatenko
Copy link
Collaborator

@zlebnik Thanks for info. I'm on fixing it.

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

No branches or pull requests

4 participants