note 92975 modified in function.mail by danbrown

From: Date: Mon, 17 Aug 2009 18:21:04 +0000
Subject: note 92975 modified in function.mail by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159570@lists.php.net to get a copy of this message
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); } ?> --was-- 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. 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); } http://php.net/manual/en/function.mail.php

« previous php.notes (#159570) next »