php發送html格式文本郵件的方法,
本文執行個體講述了php發送html格式文本郵件的方法。分享給大家供大家參考。具體實現方法如下:
<?php $to = "simon@mailexample.com, elaine@mailexample.com"; //設定收件者 $subject = "This is a test"; //設定E-mail主題 //設定E-mail內容:$message = " This is a test Dear all,
This is a test for HTML mail sending.
"; //設定郵件標頭Content-type header $header = "MIME-Version: 1.0/r/n"; //設定MIME版本 $header .= "Content-type: text/html; charset=iso-8859-1/r/n"; //設定內容類型和字元集 //設定收件者、寄件者資訊 $header .= "To: Simon , Elaine /r/n"; //設定收件者 $header .= "From: PHP Tester /r/n"; //設定寄件者 $header .= "Cc: Peter@mailexample.com/r/n"; // 設定抄送 $header .= "Bcc: David@mailexample.com/r/n"; // 設定暗抄 echo $header; mail($to, $subject, $message, $header); //發送郵件 ?>
希望本文所述對大家的php程式設計有所協助。
http://www.bkjia.com/PHPjc/1014425.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1014425.htmlTechArticlephp發送html格式文本郵件的方法, 本文執行個體講述了php發送html格式文本郵件的方法。分享給大家供大家參考。具體實現方法如下: php $to = "...