//phpmailer下载地址
<?php
include("class.phpmailer.php");
include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded
$mail = new PHPMailer();
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2; //is debug
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.domain.com"; // sets GMAIL as the SMTP server smtp.gmail.com
$mail->Port = 465; // set the SMTP port
$mail->Username = "1234567@domain.com"; // qq username
$mail->Password = "1234567"; // GMAIL passwordfds_E%$432blog_
$mail->From = "1234567@domain.com";
$mail->FromName = "1234567@domain.com";//$shorttitle
$mail->Subject = "test_title";
$mail->AltBody = "31232132121"; //Text Body
$mail->WordWrap = 50; // set word wrap
$mail->MsgHTML("31232132121邮件测test试邮件测test试邮件测test试邮件测test试1232132131");
$mail->AddReplyTo("1234567@domain.com","test");//回复地址(邮箱,姓名)
$mail->AddAddress("test@domain.com","收件人姓名");//收件箱 可能被认为垃圾邮件
$mail->IsHTML(true); // send as HTML
$mail->AddAttachment("t.gif");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent".date('Y-m-d H:m:s');
}
?>
Comments are closed.