note 99822 modified in function.mail by danbrown

From: Date: Thu, 09 Sep 2010 14:08:46 +0000
Subject: note 99822 modified in function.mail by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-172404@lists.php.net to get a copy of this message
Italian users cursing against "È" and other uppercase-accented-vowels ("vocali maiuscole accentate"") in subjects! While the lowercase ones ("è", "é" and so on) work as expected, qmail doesn't handle the uppercase ones. To fix it, the only way I found was this: <?php 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"; mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header); } ?> It should apply to other languages too. --was-- Italian users cursing against "È" and other uppercase-accented-vowels ("vocali maiuscole accentate"") in subjects! While the lowercase ones ("è", "é" and so on) work as expected, qmail doesn't handle the uppercase ones. To fix it, the only way I found was this http://bitprison.net/php_mail_utf-8_subject_and_message : <?php 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"; mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header); } ?> It should apply to other languages too. http://php.net/manual/en/function.mail.php

« previous php.notes (#172404) next »