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

EmailMultiAlternatives bcc not working #59

Open
sandeepsayone opened this issue Jul 20, 2017 · 5 comments
Open

EmailMultiAlternatives bcc not working #59

sandeepsayone opened this issue Jul 20, 2017 · 5 comments

Comments

@sandeepsayone
Copy link

Giving bcc attribute is giving error

mail = EmailMultiAlternatives(subject="Your Subject", body="This is a simple text email body.", from_email="Yamil Asusta <[email protected]>", to=["[email protected]"], bcc=["[email protected]"])
mail.send()
python_http_client/client.py", line 161, in _make_request
    raise exc
BadRequestsError
@sklarsa
Copy link

sklarsa commented Jul 20, 2017

I'm actually getting the same error when passing in additional headers to the EmailMultiAlternatives constructor like so: headers={"Reply-To": "[email protected]"}.

I wish I could get more debugging information from the exception itself but it looks it's being raised incorrectly in python_http_client, (line 161 should just be raise to preserve the stack trace).

I'm going to dig into this more to see if I can discover what's going on

@sklarsa
Copy link

sklarsa commented Jul 24, 2017

I actually ended up creating a new repo (https://github.com/sklarsa/django-sendgrid-v4) to support the sendgrid-python v4.0+ library. It should be compatible with both the EmailMessage and EmailMultiAlternatives django classes, and I'm currently writing out the test suite to guarantee that.

Unfortunately, it looks like this library isn't being maintained on a regular basis, seeing as how PR #58 is accepted(yet still open), and @pcraciunoiu has been left hanging on PR #55, which is a pretty critical PR that deals with breaking changes.

I don't like the idea of creating a new library for basically the same thing, but I am in need of a working sendgrid/django backend for my app. I'd like to hit other unaddressed issues from this repo as well (such as successfully sending emails with embedded images). I'd be happy to accept any help (including Issues and PRs), and am also very open to working with sendgrid and/or the maintainer of this repo to keep this functionality alive.

@andriisoldatenko
Copy link
Collaborator

b'{"errors":[{"message":"Each email address in the personalization block should be unique between to, cc, and bcc. We found the first duplicate instance of [[email protected]] in the personalizations.0.bcc field.","field":"personalizations.0","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.recipient-errors"}]}'

@andriisoldatenko
Copy link
Collaborator

@sandeepsayone please take a look.

@sandeepsayone
Copy link
Author

@andriisoldatenko thanks. Issues seems to be with to and bcc. I tried with unique emails in to and bcc and it worked. But not working when the to list is empty. I wanted to send emails to many email addresses without each of them knowing who else got the message (bcc) and don't want to give to email address.

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

3 participants