note 95753 added to function.mb-send-mail

From: Date: Wed, 20 Jan 2010 11:20:49 +0000
Subject: note 95753 added to function.mb-send-mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-165129@lists.php.net to get a copy of this message
If you have problem using mb_send_mail to send utf-8 mails, you have to know the following things (I've spent hours on the net before finding the correct php code) : - You have to use the mb_encode_mimeheader function on the sender name and on the recipient name (on names, not on emails !). - Subject and message are automatically encoded. - Add - at least - the following header : $headers = "Mime-Version: 1.0\n"; $headers .= "Content-Type: text/plain;charset=UTF-8\n"; $headers .= "From: $sender"; - Last but not least, beware of the internal encoding, which is needed by mb_encode_mimeheader function in order to encode properly. I had to set the internal encoding to UTF-8 in order to make it work properly : mb_internal_encoding("UTF-8"); ---- Server IP: 195.221.21.36 Probable Submitter: 80.12.110.203 ---- Manual Page -- http://www.php.net/manual/en/function.mb-send-mail.php Edit -- https://master.php.net/note/edit/95753 Del: integrated -- https://master.php.net/note/delete/95753/integrated Del: useless -- https://master.php.net/note/delete/95753/useless Del: bad code -- https://master.php.net/note/delete/95753/bad+code Del: spam -- https://master.php.net/note/delete/95753/spam Del: non-english -- https://master.php.net/note/delete/95753/non-english Del: in docs -- https://master.php.net/note/delete/95753/in+docs Del: other reasons-- https://master.php.net/note/delete/95753 Reject -- https://master.php.net/note/reject/95753 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165129) next »