sendgrid / sendgrid-python

The Official Twilio SendGrid Python API Library
https://sendgrid.com
MIT License
1.53k stars 711 forks source link

Bad request 400 when i try to send email #974

Closed dimkoug closed 3 years ago

dimkoug commented 3 years ago

in my settings.py

EMAIL_BACKEND = 'sendgrid_backend.SendgridBackend' SENDGRID_API_KEY = 'my api key ' SENDGRID_CLIENT_URL = 'https://api.sendgrid.com/v3/mail/send'

and in my view

`from django.core.mail import send_mail, EmailMessage

  msg = EmailMessage(
            subject="Hello, World!",
            body="Hello, World!",
            from_email="t@t.com",
            to=["t@t.com"],
            cc=["t@t.com"],
            bcc=["t@t.com"],
            reply_to=["t@t.com"],
    )
    msg.send(fail_silently=False)

`