SMTPDebug = 0; //使用SMPT验证 $mail->SMTPAuth = true; //SMTP验证的用户名称 $mail->Username = ""; //SMTP验证的秘密 $mail->Password = ""; //设置编码格式 $mail->CharSet = &"/> SMTPDebug = 0; //使用SMPT验证 $mail->SMTPAuth = true; //SMTP验证的用户名称 $mail->Username = ""; //SMTP验证的秘密 $mail->Password = ""; //设置编码格式 $mail->CharSet = &">

Home >Backend Development >PHP Tutorial >php发送邮件问题(smtp的问题)

php发送邮件问题(smtp的问题)

WBOY
WBOYOriginal
2016-06-02 11:33:29976browse

php

require_once('./class.phpmailer.php');
$mail= new PHPMailer();
$body= "发送邮件成功";
//采用SMTP发送邮件
$mail->IsSMTP();
//邮件服务器
$mail->Host = "smtp.163.com";
$mail->SMTPDebug = 0;
//使用SMPT验证
$mail->SMTPAuth = true;
//SMTP验证的用户名称
$mail->Username = "";
//SMTP验证的秘密
$mail->Password = "";
//设置编码格式
$mail->CharSet = "utf-8";
//设置主题
$mail->Subject = "测试";

//设置发送者
$mail->SetFrom('****@163.com', 'test');

//接受者邮件名称
$mail->AddAddress("***@163.com", "test");//发送邮件
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
这个代码的问题在哪 ????

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn