Commit fafb5091 authored by filip's avatar filip

Corrected welcome email encoding to utf-8

The conversion to iso-8859-1 causes compatibility problems with some languages, therefore the transition to utf-8
parent 75bde1b8
......@@ -214,6 +214,9 @@ class page_action extends tform_actions {
// send a welcome email to create the mailbox
// mail($this->dataRecord["email"],$app->tform->wordbook["welcome_mail_subject"],$app->tform->wordbook["welcome_mail_message"]);
/*
// the conversion to iso-8859-1 causes compatibility problems, therefore the transition to utf-8
// tries to detect current charset, and encode subject-header and body from it to ISO-8859-1.
$fromCharset = mb_detect_encoding($app->tform->lng("welcome_mail_subject"));
$iconvPreferences = array("input-charset" => $fromCharset,
......@@ -235,6 +238,22 @@ class page_action extends tform_actions {
mail($mailTarget, $mailSubject, $mailBody, $mailHeaders);
*/
$welcomeFromName = $app->tform->lng("welcome_mail_fromname_txt");
$welcomeFromEmail = $app->tform->lng("welcome_mail_fromemail_txt");
$mailHeaders = "MIME-Version: 1.0" . "\n";
$mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n";
$mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n";
$mailHeaders .= "From: $welcomeFromName <$welcomeFromEmail>" . "\n";
$mailHeaders .= "Reply-To: <$welcomeFromEmail>" . "\n";
$mailTarget = $this->dataRecord["email"];
$mailSubject = "=?utf-8?Q?" . imap_8bit($app->tform->lng("welcome_mail_subject")) . "?=";
$mailBody = $app->tform->lng("welcome_mail_message");
mail($mailTarget, $mailSubject, $mailBody, $mailHeaders);
// Spamfilter policy
$policy_id = intval($this->dataRecord["policy"]);
if($policy_id > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment