Does GMAIL RESTful API support sending of non-ASCII emails addresses?

400 Views Asked by At

We have been using the GMAIL Restful APIs to send emails. However, recently we have been receiving requests for support to send emails to non-ASCII email addresses.

I was able to use RFC2047 (Mime-encoded word) to properly encode the subject and the "from" email address headers. But using the same method for the "to"-recipient email addresses failed.

So my questions are :

  1. Has anyone successfully sent emails to non-ASCII recipients using GMAIL RESTful APIs?
  2. Or do we have any documentation i can read on how i can do this using the restful apis?

Thank you so very much for your time and I apologize in advance if this is a duplicate somewhere.

1

There are 1 best solutions below

2
Mateo Randwolf On

Workaround

This answer is posted as Community wiki as it is sourced be two great Stack Overflow answers on the topic.

At the moment of this answer, Gmail and other mailing services are still transitioning from only supporting ASCII characters to support UNICODE characters in the email addresses and subject forms. Therefore, you will need to encode your email address string in base64 to be able to send the emails.

This Stack Overflow answer clearly details everything related to how the domains and names of email addresses are being interpreted by mailing servers and the workaround to be able to send a email programmatically to these addresses.

If you want a more specific Gmail API answer, this other Stack Overflow solution explains how you should encode your string to be able to send these non-ASCII emails.