Smtp错误:无法进行身份验证。发送邮件时出现问题。

编程入门 行业动态 更新时间:2024-10-10 00:29:44
本文介绍了Smtp错误:无法进行身份验证。发送邮件时出现问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

将错误视为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错误:无法进行身份验证。发送邮件时出现问题。

本文发布于:2023-05-31 14:01:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/393042.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发送邮件   身份验证   错误   Smtp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!