note 77899 added to function.mb-send-mail
| From: | SohelTaslim at osu1 dot php dot net | Date: | Wed, 19 Sep 2007 06:00:08 +0000 |
| Subject: | note 77899 added to function.mb-send-mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130585@lists.php.net to get a copy of this message | ||
Easy and simple....
Send an email with Japanese contain.
<?php
/**
* @name : sendMail
* @author Taslim Mazumder Sohel
* @mailsohel62@yahoo.com
* Function for sending email
*with Japanese Email Body, Subject, Sender Name.
*
* @param String $to : Receiver mail address.
* @param String $subject : email subject.
* @param int $body : mail body text.
* @param array $from_email : Sender mail address.
* @param array $from_name : Sender Name.
*
*/
function sendMail($to, $subject, $body, $from_email,$from_name)
{
$headers = "MIME-Version: 1.0 \n" ;
$headers .= "From: " .
"".mb_encode_mimeheader
(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" .
"<".$from_email."> \n";
$headers .= "Reply-To: " .
"".mb_encode_mimeheader
(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" .
"<".$from_email."> \n";
$headers .= "Content-Type: text/plain;charset=ISO-2022-JP \n";
/* Convert body to same encoding as stated
in Content-Type header above */
$body = mb_convert_encoding($body, "ISO-2022-JP","AUTO");
/* Mail, optional paramiters. */
$sendmail_params = "-f$from_email";
mb_language("ja");
$subject = mb_convert_encoding($subject, "ISO-2022-JP","AUTO");
$subject = mb_encode_mimeheader($subject);
$result = mail($to, $subject, $body, $headers, $sendmail_params);
return $result;
}
?>
----
Server IP: 219.94.145.73
Probable Submitter: 210.251.252.137
----
Manual Page -- http://www.php.net/manual/en/function.mb-send-mail.php
Edit -- https://master.php.net/note/edit/77899
Del: integrated -- https://master.php.net/note/delete/77899/integrated
Del: useless -- https://master.php.net/note/delete/77899/useless
Del: bad code -- https://master.php.net/note/delete/77899/bad+code
Del: spam -- https://master.php.net/note/delete/77899/spam
Del: non-english -- https://master.php.net/note/delete/77899/non-english
Del: in docs -- https://master.php.net/note/delete/77899/in+docs
Del: other reasons-- https://master.php.net/note/delete/77899
Reject -- https://master.php.net/note/reject/77899
Search -- https://master.php.net/manage/user-notes.php