Skip to content


php发日文邮件

发送text邮件

server需安装Multibyte String模块

  1. @mb_language("Japanese");
  2. @mb_internal_encoding('SJIS');
  3.  if(mb_send_mail($to,$subject,$message,$additional_headers)){
  4.   return $msg = "儊乕儖偑憲怣偝傟傑偟偨";
  5.  }else{
  6.   return $msg = "儊乕儖憲怣偑幐攕偟傑偟偨";
  7.  }

——————————————————————————————————

如果没安装,又需要发送日文邮件可以使用html格式.注意html的编码.
居说有些日本人会挡html邮件,所以最好用text方式.

  1. $headers  = "MIME-Version: 1.0\r\n";
  2.   $headers .= "Content-type: text/html; charset=Shift_JIS\r\n";
  3.   $headers .= "From: ".$frommail." \r\n";
  4.  
  5.   $mailmsg = sendmail($tomail,$subject,$body,$headers);
  6.   echo "";
  7.   echo "";
  8.   die;
  9.  
  10.  
  11. function sendmail($to, $subject, $message, $additional_headers = "") {
  12.  if(@mail($to,$subject,$message,$additional_headers)){
  13.   return $msg = "儊乕儖偑憲怣偝傟傑偟偨";
  14.  }else{
  15.   return $msg = "儊乕儖憲怣偑幐攕偟傑偟偨";
  16.  }
  17. }

Posted in PHP, 技术.


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.