We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When sending an email only containing ASCII:
require_once("./class.simple_mail.php"); $from = '[email protected]'; $email = new SimpleMail(); $email->setFrom($from, 'Me') ->setParameters('-f'.$from) ->setReplyTo($from, '') ->setTo('[email protected]', 'Someone') ->setTo('[email protected]', 'Another one') ->setSubject('Subject') ->setMessage('Check your email.'); $email->send();
I got the following error in my e-mail Inbox:
host mailfilter.hostnet.nl[91.184.19.251] said: 550 Subject contains invalid characters. (in reply to end of DATA command)
So I changed the encodeUtf8Word() to:
/** * encodeUtf8Word * * @param string $value The word to encode. * * @return string */ public function encodeUtf8Word($value) { $isAscii = true; for ($i=0; $i<strlen($value); $i++) { $ch = ord(substr($value, $i, 1)); if ($ch >= 128) { $isAscii = false; break; } } if ($isAscii) { return $value; } else { return sprintf('=?UTF-8?B?%s?=', base64_encode($value)); } }
After this change, the email sends correctly, no error anymore.
So encodeUt8Word() should prefer plain ASCII, without encoding.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When sending an email only containing ASCII:
I got the following error in my e-mail Inbox:
So I changed the encodeUtf8Word() to:
After this change, the email sends correctly, no error anymore.
So encodeUt8Word() should prefer plain ASCII, without encoding.
The text was updated successfully, but these errors were encountered: