<?php

require 'PHPMailerAutoload.php';
require_once('class.phpmailer.php');
require_once("class.smtp.php");
$mail  = new PHPMailer();

$mail->CharSet    ="UTF-8";                 //趨ʼ룬ĬISO-8859-1ĴΪ UTF-8
$mail->IsSMTP();                            // 趨ʹSMTP
$mail->SMTPAuth   = true;                   //  SMTP ֤
$mail->SMTPSecure = "ssl";                  // SSL
$mail->SMTPDebug = 2;
$mail->Host       = "smtp.xxx.com";       // SMTP 
$mail->Port       = 465;                    // SMTPĶ˿ں
$mail->Username   = "xxx@xxx.com";  // SMTPû
$mail->Password   = "xxx";        // SMTP
$mail->SetFrom('xxx@xxx.com', 'qq');    // ÷˵ַ
$mail->AddReplyTo("xxx@xxx.com","xxx@xxx.com");
                                            // ʼظ˵ַ
$mail->Subject    = 'xxx';                     // ʼ
$mail->AltBody    = "Ϊ˲鿴ʼл֧ HTML ʼͻ";
                                            // ѡ¼ݿ
$mail->MsgHTML('<html>helo</html>');                         // ʼ
$mail->AddAddress('xxx@xxx.com', "xxx@xxx.com");
//$mail->AddAttachment("images/phpmailer.gif"); // 
if(!$mail->Send()) {
    echo "ʧܣ" . $mail->ErrorInfo;
} else {
    echo "ϲʼͳɹ";
}

?>
