Set the MailService Charset before setting the body

msgHTML builds the text/plain part by converting the passed html to text in the current CharSet; the default Charset being iso-8859-1, most non-ascii characters are lost.

fixes #416
This commit is contained in:
Nicolas Bouilleaud 2019-04-15 17:21:40 +02:00
parent b272a5a7a1
commit 6b91a226ba

View File

@ -68,10 +68,10 @@ class MailService {
// Bodies
$body = $body . ' <br/><br/>' . __('Mail', 'Thank you for your trust.') . ' <br/>' . NOMAPPLICATION . ' <hr/>' . __('Mail', "\"The road is long, but the way is clear…\"<br/>Framasoft lives only by your donations.<br/>Thank you in advance for your support https://soutenir.framasoft.org");
$mail->isHTML(true);
$mail->CharSet = 'utf-8';
$mail->msgHTML($body, ROOT_DIR, true);
// Build headers
$mail->CharSet = 'UTF-8';
$mail->addCustomHeader('Auto-Submitted', 'auto-generated');
$mail->addCustomHeader('Return-Path', '<>');