note 92976 added to function.mail

From: Date: Mon, 17 Aug 2009 18:29:49 +0000
Subject: note 92976 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-159577@lists.php.net to get a copy of this message
(this corrects my previous mail, function was wrong. I find this notable as none of the other functions listed here worked - nor any I googled) UTF-8 and QMail This function should work for all of you, who want to switch to UTF-8 email - especially if using Qmail as Mailserver. QMail seems to have problems with the "\r\n" in the header section. I found it helpful to replace them with "\n". function mail_utf8($to, $subject = '(No subject)', $message = '', $from) { $header = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'From: Yourname <' . $from . ">\n"; mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header); } ---- Server IP: 217.160.72.57 Probable Submitter: 92.227.222.11 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/92976 Del: integrated -- https://master.php.net/note/delete/92976/integrated Del: useless -- https://master.php.net/note/delete/92976/useless Del: bad code -- https://master.php.net/note/delete/92976/bad+code Del: spam -- https://master.php.net/note/delete/92976/spam Del: non-english -- https://master.php.net/note/delete/92976/non-english Del: in docs -- https://master.php.net/note/delete/92976/in+docs Del: other reasons-- https://master.php.net/note/delete/92976 Reject -- https://master.php.net/note/reject/92976 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159577) next »