标签:message username php word utf-8 name host customer for
<?php
require_once(“class.phpmailer.php”);
/*发送邮件*/
function sendMail($to, $subject, $message)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = “smtp.qq.com”;
$mail->SMTPAuth = true;
$mail->Username = “10000@qq.com”;
$mail->Password = “***************”;
$mail->Port=25;
$mail->CharSet = “utf-8″;
$mail->From = “10000@qq.com”; //邮件发送者email地址
$mail->FromName = “邮件发送者名称”;
$mail->AddAddress(“$to”, “*****”);
$mail->Subject = $subject; //邮件标题
$mail->Body = $message; //邮件内容
$mail->AltBody = “This is the body in plain text for non-HTML mail clients”;
return $mail->Send();
}
sendMail(‘customer@163.com’, ‘测试邮件功能’, ‘测试邮件功能’);
?>
标签:message username php word utf-8 name host customer for
原文地址:http://www.cnblogs.com/112ba/p/6220426.html