Open blummarci24 opened 1 week ago
There is a failing code in the legacy Localization.php in translateCharsetMIME function causing error on email sending.
The failing code is here:
$result = mb_encode_mimeheader($string, $toCharset, $encoding);
Digging deeper it is a change in polyfill-mbstring dependency:
```public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) { trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); }```
As suggested, use iconv_mime_encode. I have a working local solution for this which fix this issue.
iconv_mime_encode
public function translateCharsetMIME($string, $fromCharset, $toCharset = 'UTF-8', $encoding = "Q") { $preferences = array( 'input-charset' => $fromCharset, 'output-charset' => $toCharset, 'line-length' => 76, 'scheme' => $encoding, 'line-break-chars' => "\n" ); $result = iconv_mime_encode('', $string, $preferences); return substr($result, 2); }
I will create a PR for this.
1. Set up an new suitecrm environment (tested on 8.7 and php 8.2) 2. Login and go to admin page 3. Configure email and try to send a test email ...
I tried the email functionality. I have not found any other topic to this certain issue, so I took a look at the code.
8.7.0
Chrome
No response
PHP 8.2
Ubuntu 20.04.6 LTS
Fix in:
https://github.com/salesagility/SuiteCRM-Core/pull/568
Issue
There is a failing code in the legacy Localization.php in translateCharsetMIME function causing error on email sending.
The failing code is here:
Digging deeper it is a change in polyfill-mbstring dependency:
Possible Fix
As suggested, use
iconv_mime_encode
. I have a working local solution for this which fix this issue.Steps to Reproduce the Issue
Context
I tried the email functionality. I have not found any other topic to this certain issue, so I took a look at the code.
Version
8.7.0
What browser are you currently using?
Chrome
Browser Version
No response
Environment Information
PHP 8.2
Operating System and Version
Ubuntu 20.04.6 LTS