note 92975 deleted from function.mail by danbrown
| From: | danbrown@php.net | Date: | Mon, 17 Aug 2009 18:31:26 +0000 |
| Subject: | note 92975 deleted from function.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159579@lists.php.net to get a copy of this message | ||
Note Submitter: mauice [at] example [dot] com
----
QMail / UTF-8
We use qmail on our server and I had some trouble switching to UTF-8 mail().
QMail seems to dislike \r\n - just give it \n instead.
<?php
function mail_utf8($to, $subject = '(No subject)', $message = '', $from) {
$header_ = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain;
charset=UTF-8' . "\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ .
$from);
}
?>