Short answer:
You have to send the name encoded with MIME encoded-word syntax.
"指定<johndoe@example.com>"
would be "=?utf-8?B?5oyH5a6a?= <johndoe@example.com>"
Long Answer:
Althoug @dezinezync answer is correct, it only works for non-ASCII characters so if you want to set a friendly name as "指定" or any other (my problem was with spanish/latin characters "á, é, í, ó, ú" showing the symbol � instead) you have to encode the string.
Acording to amazonSES javascript SDK Docs
The sender name (also known as the friendly name) may containnon-ASCII characters. These characters must be encoded using MIMEencoded-word syntax, as described in RFC 2047. MIME encoded-wordsyntax uses the following form: =?charset?encoding?encoded-text?=.
So using utf-8 and base64 encoding you will be able to set the name you need.
Encoding 指定
to base64 will give you this string 5oyH5a6a
and based on the RFC 2047 MIME encoded-word-syntax you have to replace the encode-text in the form:
=?charset?encoding?encoded-text?= <email@domain.com>
Resulting:
=?utf-8?B?5oyH5a6a?= <email@domain.com>
Where =?
marks the begining and the end of the encoded string, utf-8
is the charset (which support japanese characters) and the B
is the encoding, can be either "Q" (denoting Q-encoding) or "B" (denoting base64 encoding) and finally 5oyH5a6a
the base64 string that represents 指定
.
Thats it! :)
Here is code I found in php (haven't test it) that uses the Q-encoding:
<?php$name = ""; // kanji$mailbox = "kru";$domain = "gtinn.mon";$addr = mb_encode_mimeheader($name, "UTF-7", "Q") . " <" . $mailbox . "@" . $domain . ">";echo $addr;
Here is the link of the code https://doc.bccnsoft.com/docs/php-docs-7-en/function.mb-encode-mimeheader.html
And other references:
https://nerderati.com/2017/06/09/mime-encoded-words-in-email-headers
Hope it helps!