Accent in emails

This commit is contained in:
Bertrand 2012-06-11 23:29:10 +02:00
parent e4ac17e34d
commit 6ebaf0fecf
3 changed files with 11 additions and 2 deletions

View File

@ -138,7 +138,14 @@ class Question
return $this->answers;
}
function mail_utf8($to, $subject = '(No subject)',
$message = '', $header = '')
{
$header_ = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/plain; charset=UTF-8' . "\r\n";
return (mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=',
$message, $header_ . $header));
}
}

View File

@ -84,6 +84,8 @@ class QuestionsFile
$this->treeXML->formatOutput = true;
$this->treeXML->save($this->filename);
}
}
?>

View File

@ -103,7 +103,7 @@ cette adresse email.\n\n"
;
if (mail($to, $subject, $message, $headers))
if ($quest->mail_utf8($to, $subject, $message, $headers))
{
echo ("Email sent");
}