require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= "I finally successfully sent the email! Haha!
http://news.qq.com/a/20111115 /000792.htm?qq=0&ADUIN=594873950&ADSESSION=1321316731&ADTAG=CLIENT.QQ.3493_.0";
//Send mail using SMTP
$mail->IsSMTP();
//Mail server
$mail->Host = "smtp.163.com";
$mail->SMTPDebug = 0;
//Use SMPT verification
$mail-> SMTPAuth = true;
//Username for SMTP authentication
$mail->Username = "********@163.com";
//Secret for SMTP authentication
$mail->Password = "***";
//Set encoding format
$mail->CharSet = "utf-8";
//Set theme
$mail ->Subject = "Test";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
//Set the sender
$mail ->SetFrom('****@163.com', 'test');
//Send email in html format
$mail->MsgHTML($body);
// Recipient email name
$mail->AddAddress("***@163.com", "test");//Send email
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}