0

更新到 sendgrid 的 python 客户端最新版本后,bcc 字段中的地址不再接收电子邮件。

这是用于发送邮件的代码:

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)

github上有一个未解决的问题,但看起来没有任何进展:

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

任何人都有不涉及使用非常旧版本的修复或解决方法?

4

1 回答 1

0

您正在使用的当前版本有一个解决方法。这是它的链接:

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

最新版本的行为与您希望的完全一样。add_to 方法用于默认使用 SMTPAPI 标头而不是常规 To 参数。现在它已被还原,为了将收件人添加到 SMTPAPI,您必须明确地这样做。如果您有更多问题,请告诉我,很高兴回答。

于 2014-10-22T17:53:32.717 回答