You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please check these things before submitting your issue:
Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
Make sure you're using the latest version of PHPMailer
Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
Include sufficient code to reproduce your problem
If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!
Problem description
In the PHPMailer.php, there is a code that set $charset = "us-ascii" if the input string does not have 8-bit characters.
Eek. That's quite tricky. I guess we may need a way to set the fallback 7-bit charset to something other than us-ascii. I assume it works ok if you use UTF-8?
Please check these things before submitting your issue:
SMTPDebug = 2
setphpmailer
, but search first!Problem description
In the
PHPMailer.php
, there is a code that set$charset = "us-ascii"
if the input string does not have 8-bit characters.PHPMailer/src/PHPMailer.php
Lines 3282 to 3286 in 3dffb3e
In Japan, 7-bit charset
ISO-2022-JP
has been used historically.The
has8bitChars($str)
method returnsfalse
when theISO-2022-JP
string are passed.As a result, PHPMailer generates
us-ascii
MIME headers when theISO-2022-JP
charset is set. For example:Code to reproduce
The result is:
I believe that the
mb_convert_encoding($str, 'ISO-2022-JP')
is required for each header fields. For example:But it also doesn't work without the conversion.
Tested environment
Related issues
The text was updated successfully, but these errors were encountered: