filip
2010-10-11 fafb50913c3100eee68b4691bc7d78515829dff0
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


1 files modified
19 ■■■■■ changed files
interface/web/mail/mail_user_edit.php 19 ●●●●● patch | view | raw | blame | history
interface/web/mail/mail_user_edit.php
@@ -214,6 +214,9 @@
        // 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 @@
        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) {