将错误视为SMTP错误:无法进行身份验证。 发送邮件时出现问题。 它在localhost中工作,但是上传到服务器后显示
getting the error as SMTP Error: Could not authenticate. Problem in Sending Mail. It is working in localhost, but after uploading to server it is showing
引用:SMTP错误:无法进行身份验证。 发送邮件时遇到问题。
SMTP Error: Could not authenticate. Problem in Sending Mail.
我尝试过:
What I have tried:
Quote:require('phpmailer / class.phpmailer.php'); $ mail = new PHPMailer(); $ mail-> IsSMTP(); $ mail-> SMTPDebug = 0; $ mail-> SMTPAuth = TRUE; $ mail-> SMTPSecure =tls; $ mail-> Port = 587 ; $ mail-> Username =******@gmail; $ mail->密码=****** ***; $ mail-> Host =smtp.gmail; $ mail-> Mailer =smtp; $ mail-> SetFrom($ _ POST [userEmail],$ _ POST [userName]); $ mail-> AddReplyTo($ _ POST [userEmail ],$ _POST [userName]); $ mail-> AddAddress(akilesh1111@gmail); $ mail-> Subject = $ _POST [subject]; $ mail-> WordWrap = 80; $ mail - > MsgHTML($ _ POST [content]); if(is_array($ _ FILES)){ $ mail- > AddAttachment($ _ FILES [ 'attachmentFile'] [ 'tmp_name的值'],$ _ FILES [ 'attachmentFile'] [ '名称']); } $ mail-> IsHTML(true); if(!$ mail-> Send()){ echo
发送邮件时出现问题。
require('phpmailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 0; $mail->SMTPAuth = TRUE; $mail->SMTPSecure = "tls"; $mail->Port = 587; $mail->Username = "******@gmail"; $mail->Password = "*********"; $mail->Host = "smtp.gmail"; $mail->Mailer = "smtp"; $mail->SetFrom($_POST["userEmail"], $_POST["userName"]); $mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]); $mail->AddAddress("akilesh1111@gmail"); $mail->Subject = $_POST["subject"]; $mail->WordWrap = 80; $mail->MsgHTML($_POST["content"]); if(is_array($_FILES)) { $mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']); } $mail->IsHTML(true); if(!$mail->Send()) { echo "
Problem in Sending Mail.
联系邮件发送。
推荐答案
mail = new PHPMailer(); mail = new PHPMailer();
mail-> IsSMTP (); mail->IsSMTP();
mail-> SMTPDebug = 0; mail->SMTPDebug = 0;
更多推荐
Smtp错误:无法进行身份验证。发送邮件时出现问题。
发布评论