Accented characters in HTML content are causing Gmail to truncates the email
nicpalard opened this issue · 2 comments
nicpalard commented
Issue Summary
Gmail adds the "clipped mail" footer for every mail send with SendGrid that contains accented character in the HTML content. The mail is not really clipped as it contains the entire content.
Steps to Reproduce
- Send a mail with an accented character in the html_content
- Go to Gmail
Code Snippet
mail = Mail(
from_email='myemail@gmail.com',
to_emails='myotheremail@gmail.com',
subject="Accented characters are causing Gmail to truncates the email",
html_content="Hello world - é"
)
Exception/Log
As can be seen above, the mail says "message tronqué" which means truncated message but it still contains the entire content.The same code without the accented character produces the following:
When inspecting the source email we can see that, when the email contains an accented character the charset is set to
Content-Type: text/html; charset=iso-8859-1
while when it does not it is set to Content-Type: text/html; charset=us-ascii
Technical details:
- sendgrid-python version: 6.8.0
- python version: 3.6.8
JenniferMah commented
Hi @nicpalard! Can you try the work around listed in this issue to force UTF-8 encoding by adding a unicode character?
JenniferMah commented
Closing due to inactivity. Please open a new github issues if you need any additional help.