欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解析php中用PHPMailer來(lái)發(fā)送郵件的示例(126.com的例子)

 更新時(shí)間:2013年06月24日 11:08:14   作者:  
本篇文章是對(duì)php中用PHPMailer來(lái)發(fā)送郵件的示例(126.com的例子)進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
<?php
require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= "我終于發(fā)送郵件成功了!呵呵!goodboy xxxxxxx!<br/><a>http://news.qq.com/a/20111115/000792.htm?qq=0&ADUIN=594873950&ADSESSION=1321316731&ADTAG=CLIENT.QQ.3493_.0</a>";
//采用SMTP發(fā)送郵件
$mail->IsSMTP();
//郵件服務(wù)器
$mail->Host       = "smtp.126.com";
$mail->SMTPDebug  = 0;
//使用SMPT驗(yàn)證
$mail->SMTPAuth   = true;
//SMTP驗(yàn)證的用戶名稱
$mail->Username   = "xxxxxxx@126.com";
//SMTP驗(yàn)證的秘密
$mail->Password   = "password";
//設(shè)置編碼格式
$mail->CharSet  = "utf-8";
//設(shè)置主題
$mail->Subject    = "測(cè)試";
//$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
//設(shè)置發(fā)送者
$mail->SetFrom('xxxxxxx@126.com', 'test');
//采用html格式發(fā)送郵件
$mail->MsgHTML($body);
//接受者郵件名稱
$mail->AddAddress("xxxxxxx@126.com", "test");//發(fā)送郵件
if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

相關(guān)文章

最新評(píng)論