require_once('../class.phpmailer.php');
$mail= new PHPMailer();
$body= "I finally successfully sent the email! Haha! goodboy!
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.mail.yahoo.com.cn";
$mail->SMTPDebug = 0;
//Use SMPT verification
$mail->SMTPAuth = true;
//Username for SMTP authentication
$mail->Username = "********@yahoo.cn";
// The secret of SMTP verification
$mail->Password = "y************";
//Set the encoding format
$mail->CharSet = "utf-8" ;
//Set the theme
$mail->Subject = "Test";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
//Set the sender
$mail->SetFrom('*******@yahoo.cn', 'test');
//Send email in html format
$mail->MsgHTML($body);
//Recipient email name
$mail->AddAddress("************@yahoo.com", "test") ;//Send mail
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}