0

php mail()邮件发送html邮件

网站研究 区区第二 2010-05-13 22:08:30

 

  1. <html>  
  2. <head>  
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  4. <title>Send mail</title>  
  5. </head>  
  6. <?php  
  7. date_default_timezone_set(PRC);  
  8.  
  9. $to = 'czlc@163.com';    
  10. //$to = 'hnbwww@qq.com';    
  11. // headers    
  12. $headers = 'MIME-Version: 1.0' . "rn";    
  13. $headers .= 'Content-type: text/html; charset=utf-8' . "rn";    
  14. $headers .= 'From:admin@qqd2.com' . "rn";    
  15. $headers .= 'Reply-To: admin@qqd2.com' . "rn";    
  16. $headers .= 'Cc: 15297498200@139.com' . "rn";//抄送到手机邮箱  
  17. //邮件主题  
  18. $subject    =   "邮件标题";  
  19. $subject = "=?UTF-8?B?".base64_encode("$subject")."?=";    
  20. //邮件内容  
  21. $message    =   "邮件内容content<b>加粗</b>,<br/>时间:".date("Y-m-d H:i:s");  
  22. //发送邮件  
  23. $ok =   mail($to$subject$message$headers);   
  24. //检测结果  
  25. if($okecho "Sent Mail success!";  
  26. ?> 

 

下一篇

相关文章

发表留言