We are encountering an issue with the Gmail API where some emails are sent with garbled characters.
Issue Description: The issue occurs intermittently. The same email (identical content, sender address, and recipient) will sometimes be sent with garbled characters.
Screenshots of a normal email and the garbled email are provided below:
Normal Email Screenshot
Garbled Email Screenshot
We are using Go to interact with the Gmail API. The code snippet for generating the raw email is:
https://i.sstatic.net/ZLGyJxdm.png
Screenshot of the decoded base64 string:
Decoded Base64 Screenshot
It would be great if you could help us with solving this problem. Thank you!
Because our email content is in HTML,
we suspect that special characters in the HTML might be causing the garbled text.
We removed characters such as /rn /r /n /t /v /f, etc.
We also removed characters like .
After removing the above two types of characters, there was still garbled text, so we also removed the tag.
Zhen Yuan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.