【问题标题】:CodeIgniter default mailer unable to send email using PHP SMTPCodeIgniter 默认邮件程序无法使用 PHP SMTP 发送电子邮件
【发布时间】:2020-04-19 03:22:41
【问题描述】:

我在尝试使用默认 CodeIgniter 邮件程序发送电子邮件时收到以下错误。我浏览了 StackOverflow 以找到解决方案,但没有一个答案解决了我的问题。以下是堆栈跟踪。

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--

我尝试了以下解决方案:-

  1. 为不太安全的应用启用访问权限。

  2. 将主机从 smtp.gmail.com 更改为 ssl://smtp.gmail.com

  3. 在 php.ini 文件中启用 openssl

一些答案​​表明可能会生成此问题,因为如果帐户中启用了 2 因素身份验证,因此我们必须遵循谷歌帮助页面(针对 Gmail)中提到的一些步骤。就我而言,2 因素身份验证未启用,因此我排除了这种可能性。

【问题讨论】:

    标签: php codeigniter email smtp gmail


    【解决方案1】:

    与谷歌沟通后,我得到了很多建议(不是具体的答案)。他们要求我尝试一些步骤。其中一个建议是启用 IMAP 访问,它解决了我的问题。如果您想尝试此补救措施,请转到 Gmail 收件箱并按照以下步骤操作。

    第 1 步:

    第 2 步:

    第 3 步:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-10
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 2018-03-23
      • 2017-02-15
      • 1970-01-01
      • 2016-05-18
      相关资源
      最近更新 更多