0

After updating to the latest version of sendgrid's python client, the addresses in the bcc field no longer receive emails.

Here's the code used to send the mail:

headers = json.JSONEncoder().encode({'X-SMTPAPI' : headers.json_string()}) if headers else None
email = sendgrid.Mail(from_email=from_email,
                      from_name=from_name,
                      to=to_emails,    # list of email addresses
                      cc=cc,    # list of email addresses
                      bcc=bcc,  # list of email addresses
                      subject=subject,
                      html=html,
                      text=text,
                      headers=headers)

There's an open issue on github, but it doesn't look like any progress has been made:

https://github.com/sendgrid/sendgrid-python/issues/83

Anyone have a fix or workaround that doesn't involve using a very old version?

Suhaas Prasad
  • 101
  • 2
  • 5

1 Answers1

0

There is a workaround for the current version you are using. Here is the link to it:

https://github.com/sendgrid/sendgrid-python/issues/83#issuecomment-59974718

The latest version behaves exactly as you wish it to behave. The add_to method used to default to the SMTPAPI header instead of the regular To parameter. Now it has been reverted and in order to add recipients to the SMTPAPI you must explicitly do so. Let me know if you have more questions, be glad to answer them.

elbuo
  • 106
  • 7