Define a mail Send function
function SendMail ($address, $title, $message) {
//导入mail类文件require("./PHPMailer/class.phpmailer.php");//创建mail对象$mail=new PHPMailer();$mail->IsSMTP();$mail->Host="smtp.163.com";$mail->SMTPAuth =true;$mail->Username= "18501773419@163.com";$mail->Password= "x x x x x x";$mail->From = "18501773419@163.com";$mail->FromName= "乐分享weshare";$mail->AddAddress($address);$mail->IsHTML(true);$mail->Subject=$title;$mail->Body =$message;
if (! $mail->send ()) {
return true;
}else{
return false;
}
}
SendMail ("18501773419@163.com", "Test", "Hello I Am Peace");
?>
PHP uses Phpmailer to send messages that are not authenticated (SMTP error:could not authenticate.), after commenting out the verification code, and then showing the following from address failed:?
Reply content:
Define a mail Send function
function SendMail ($address, $title, $message) {
//导入mail类文件require("./PHPMailer/class.phpmailer.php");//创建mail对象$mail=new PHPMailer();$mail->IsSMTP();$mail->Host="smtp.163.com";$mail->SMTPAuth =true;$mail->Username= "18501773419@163.com";$mail->Password= "x x x x x x";$mail->From = "18501773419@163.com";$mail->FromName= "乐分享weshare";$mail->AddAddress($address);$mail->IsHTML(true);$mail->Subject=$title;$mail->Body =$message;
if (! $mail->send ()) {
return true;
}else{
return false;
}
}
SendMail ("18501773419@163.com", "Test", "Hello I Am Peace");
?>
PHP uses Phpmailer to send messages that are not authenticated (SMTP error:could not authenticate.), after commenting out the verification code, and then showing the following from address failed:?
Mailbox needs to turn on the SMTP service, you can set the ~ 163 mailbox in the mailbox should be assigned the SMTP password separately
(PS: Use QQ mailbox sent to note that the port number is not the default of!!!)
Class.smtp.php's not require.
Look at the log of the environment and raise the debug level of the next phpmailer to see