With 'to' address it is completely working fine, but with bcc or cc it is throwing error.
msg = EmailMessage(from_email=settings.DEFAULT_FROM_EMAIL, bcc=[user_email])
msg.send()
Failed to send email HTTP Error 400: Bad Request
Traceback (most recent call last):
File "/usr/lib/python3.8/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/python3.8/dist-packages/sendgrid_backend/mail.py", line 129, in send_messages
resp = self.sg.client.mail.send.post(request_body=data)
File "/usr/local/lib/python3.8/dist-packages/python_http_client/client.py", line 277, in http_request
self._make_request(opener, request, timeout=timeout)
File "/usr/local/lib/python3.8/dist-packages/python_http_client/client.py", line 184, in _make_request
raise exc
python_http_client.exceptions.BadRequestsError: HTTP Error 400: Bad Request
With 'to' address it is completely working fine, but with bcc or cc it is throwing error.