简体   繁体   English

CodeIgniter 默认邮件程序无法使用 PHP SMTP 发送电子邮件

[英]CodeIgniter default mailer unable to send email using PHP SMTP

I am getting the following error while trying to send the email using the default CodeIgniter mailer.尝试使用默认的 CodeIgniter 邮件程序发送电子邮件时出现以下错误。 I have browsed the StackOverflow to find the solutions but none of the answers solved my issue.我浏览了 StackOverflow 以找到解决方案,但没有一个答案解决了我的问题。 following is the stack trace.以下是堆栈跟踪。

220 smtp.gmail.com ESMTP x11sm47816605pfn.53 - gsmtp
hello: 250-smtp.gmail.com at your service, [xxx.88.xxx.16x]
250-SIZE xxxxxxx
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
starttls: 220 2.0.0 Ready to start TLS
hello: 250-smtp.gmail.com at your service, [xxx.88.xx.16x]
250-SIZE xxxxxxxx
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8


Failed to authenticate password. Error: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials x11sm47816605pfn.53 - gsmtp
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Date: Mon, 30 Dec 2019 09:38:46 +0530
From: <xxxx@xxxxxxxx.com>
Return-Path: <xxxx@maildomain.com>
To: xxxx@xxxxxx.com
Subject: =?ISO-8859-1?Q?=xx=65=xx=7xx6=xx=x0=x1=7x0=70=xxx=69=6xx=61=7x4=6x=6x=xE?=
Reply-To: <xxxx@xxxxxxx.com>
User-Agent: CodeIgniter
X-Sender: xxxx@xxxxxxxx.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <xxxxxxxx@xxxxxx.com>
Mime-Version: 1.0

Content-Type: multipart/alternative; boundary="B_xxx_5e09xxxxxxxxx"

This is a multi-part message in MIME format. Your email application may not support this format.

--B_xxxx_5e0978xxxxxx
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

I will be absent tomorrow

--B_xxxx_xxxxxxxxxxxx
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I will be absent tomorrow

--B_xxx_5xxxxxxxxx--

I have tried the following solutions:-我尝试了以下解决方案:-

  1. Enabled access for less secure apps.启用对不太安全的应用程序的访问。

  2. Changed host from smtp.gmail.com to ssl://smtp.gmail.com将主机从 smtp.gmail.com 更改为 ssl://smtp.gmail.com

  3. enabling openssl in php.ini file在 php.ini 文件中启用 openssl

Some answers suggest that this issue might be generated because 2-factor authentication enabled in the account if it so we have to follow some steps mentioned in the google help page(for Gmail).一些答案表明,这个问题可能是因为在帐户中启用了 2 因素身份验证,所以我们必须按照谷歌帮助页面(Gmail)中提到的一些步骤进行操作。 In my case, 2 factor authentication was not enabled so I ruled out that possibility.就我而言,未启用 2 因素身份验证,因此我排除了这种可能性。

After communicating with google I got many suggestions(not a specific answer).与谷歌沟通后,我得到了很多建议(不是具体的答案)。 They requested me to try some steps.他们要求我尝试一些步骤。 One of the suggestions was enabling IMAP access and it's solved my issue.建议之一是启用 IMAP 访问,它解决了我的问题。 In case you want to try this remedy please goto Gmail inbox and follow the following steps.如果您想尝试此补救措施,请转到 Gmail 收件箱并按照以下步骤操作。

Step 1:第1步:

在此处输入图片说明

Step 2:第2步:

在此处输入图片说明

Step 3:第 3 步:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Codeigniter:您的服务器可能未配置为使用此方法发送邮件。 无法使用 PHP SMTP 发送电子邮件 - Codeigniter: Your server might not be configured to send mail using this method. Unable to send email using PHP SMTP Codeigniter 3 无法使用 PHP ZC2239A92BDE29F0A00F9173193CC2FE 发送 email。 您的服务器可能未配置为使用此方法发送邮件 - Codeigniter 3 Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method 无法使用SMTP通过PHP发送电子邮件 - Unable to Send Email Via PHP using SMTP CodeIgnititer 4:无法使用 PHP SMTP 发送 email - CodeIgnititer 4: Unable to send email using PHP SMTP 遇到以下SMTP错误:0无法使用PHP SMTP发送电子邮件 - The following SMTP error was encountered: 0 Unable to send email using PHP SMTP 无法在 codeigniter 3 中使用 SMTP gmail 配置发送电子邮件 - Unable to send email using SMTP gmail config in codeigniter 3 使用PHP Mailer发送电子邮件 - Send email using PHP Mailer 使用PHP Mailer从本地服务器外部的电子邮件地址发送smtp电子邮件 - Using PHP Mailer to send smtp emails from an email address outside the local server 使用实时服务器 SMTP 服务器通过 PHP Mailer 发送电子邮件不起作用 - Send email using live server SMTP server through PHP Mailer not working CodeIgniter中的AWS SMTP邮件错误(无法使用PHP SMTP发送电子邮件。您的服务器可能未配置为使用此方法发送邮件。) - AWS SMTP mail error in CodeIgniter (Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM