phpMailer电子邮件不发送gmail smtp [英] phpMailer email not sending gmail smtp

查看:143
本文介绍了phpMailer电子邮件不发送gmail smtp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用gmail SMTP发送电子邮件,这是我在 print_r 对象时所得到的。



我使用相同的gmail凭据到phpMailer属性的用户名和密码,所以我确定我的凭据是正确的,但不知道为什么它不发送。


$ b $感谢任何支持。

 电子邮件对象

[pathViews:protected] => application.views.email
[pathLayouts:protected] => application.views.email.layouts
[_myMailer:EMailer:private] => PHPMailer对象

[Priority] => 3
[CharSet] => UTF-8
[ContentType] => text / html
[Encoding] => 8bit
[ErrorInfo] => SMTP错误:无法验证
[From] => support@qelasy.com
[FromName] => Qelasy管理员
[Sender] =>
[主题] => Qelasy安全PIN
[Body] =>亲爱的家长,< br />< br />您已成功注册Qelasy安全系统。< br />< br />请使用此PIN激活您的平板电脑:< b> 34123< ; / b>。< br />< br />感谢您使用Qelasy安全系统注册。< br />< br />我们重视您的参与。< br />< ; br />如果您有任何问题,请致电+33 6 9881 1914或发送电子邮件至help@qelasy.com.lt; br />< br />谢谢,  Q /团队
[AltBody] =>
[WordWrap] => 0
[Mailer] => smtp
[Sendmail] => / usr / sbin / sendmail
[PluginDir] =>
[ConfirmReadingTo] =>
[主机名] =>
[MessageID] =>
[主机] => smtp.gmail.com
[Port] => 465
[Helo] =>
[SMTPSecure] => ssl
[SMTPAuth] => 1
[用户名] => appmonkeydev@gmail.com
[密码] => ********
[超时] => 10
[SMTPDebug] =>
[SMTPKeepAlive] =>
[SingleTo] =>
[LE] =>

[smtp:PHPMailer:private] => SMTP对象

[SMTP_PORT] => 25
[CRLF] =>

[do_debug] =>
[do_verp] = >
[smtp_conn:SMTP:private] =>资源ID#86
[错误:SMTP:私人] =>
[helo_rply:SMTP:private] =& mx.google.com在您的服务,[220.247.236.99]
250-SIZE 35882577
250-8BITMIME
250-AUTH登录平面XOAUTH XOAUTH2普通客户端
250增强型
250-CHUNKING
250 SMTPUTF8



[to:PHPMailer:private] => Array

[0] => Array

[0] => azraarshu@gmail.com
[1] =>




[cc:PHPMailer:private] =>数组

[0] =>数组

[0] => yohan@appmonkeyz.com
[1] => Yohan Hirimuthugoda


[1] =>数组

[0] => azraar@app-monkeyz.com
[1] => ; Azraar Azward




[bcc:PHPMailer:private] => Array



[ReplyTo:PHPMailer:private] => Array

[support@qelasy.com] => Array

[0] => support@qelasy.com
[1] => ;




[all_recipients:PHPMailer:private] => Array

[azraarshu@gmail.com] => 1
[yohan@appmonkeyz.com] => 1
[azraar@app-monkeyz.com] = > 1


[附件:PHPMailer:private] => Array



[CustomHeader:PHPMailer:private] =>数组

[0] =>数组

[0] => Cc
[1] => Yohan Hirimuthugoda< yohan @ appmonkeyz .com>


[1] =>数组

[0] => Cc
[1] =& Azward< azraar@app-monkeyz.com>




[message_type:PHPMailer:private] => plain
[boundary:PHPMailer:private] => Array

[1] => b1_631af702e0f737dd5c11dcff55e1d8ee
[2] => b2_631af702e0f737dd5c11dcff55e1d8ee


[language:protected] =>数组

[provide_address] =>您必须提供至少一个收件人电子邮件地址
[mailer_not_supported] =>不支持邮件程序
[execute] => ;
[instantiate] =>无法实例化邮件功能
[authenticate] => SMTP错误:无法验证
[from_failed] =>以下来自地址失败:
[recipient_failed] => SMTP错误:以下收件人失败:
[data_not_accepted] => SMTP错误:数据未被接受
[connect_host] => SMTP错误:无法连接到SMTP主机
[file_access] =>无法访问文件:
[file_open] =>文件错误:无法打开文件:
[encoding] = >未知编码:
[签名] =>签署错误:
[smtp_error] => SMTP服务器错误:
[empty_message] =>消息体空
[invalid_address] =>无效的地址
[variable_set] =>无法设置或重置变量:


[error_count:PHPMailer:private] => 1
[sign_cert_file:PHPMailer:private] =>
[sign_key_file:PHPMailer:private] =>
[sign_key_pass:PHPMailer:private] =>
[例外:PHPMailer:private] => 1



从Gmail收到的电子邮件。 / p>

 您好,appmonkey,

我们最近阻止了您的Google帐户登录尝试[appmonkeydev @ gmail .COM。

登录尝试详情
日期&时间:2014年8月26日星期二上午9:23:38 UTC
位置:斯里兰卡科伦坡

如果这不是你
请查看您的帐户活动页面https://security.google.com/settings/security/activity查看是否有任何疑问。谁试图登录你的帐户知道你的密码;我们建议您立即更改。

如果这是你
您可以切换到Google制作的应用程序(如Gmail)访问您的帐户(推荐)或更改您的设置,网址为https://www.google.com/ settings / security / lesssecureapps,以便您的帐户不再受现代安全标准的保护。

要了解更多信息,请参阅https://support.google.com/accounts/answer/6010255。

真诚的,
Google帐户团队


解决方案

我遇到这个问题,GMAIL不允许使用脚本发送电子邮件。登录并检查您在代码中使用的电子邮件,看看您是否收到了您帐户中恶意活动的通知。如果是的话,我通过从我的HOST登录GMAIL解决了这个问题,并允许它使用电子邮件发送邮件。



不确定这适用于你的问题


I am not able to send an email using gmail SMTP, this is what I'm getting when I print_r the object.

I'm using the same gmail credentials to Username and Password of phpMailer attributes, so I'm sure my credentials are correct but no idea why its not sending.

Thanks, appreciate any support.

EMailer Object
(
    [pathViews:protected] => application.views.email
    [pathLayouts:protected] => application.views.email.layouts
    [_myMailer:EMailer:private] => PHPMailer Object
        (
            [Priority] => 3
            [CharSet] => UTF-8
            [ContentType] => text/html
            [Encoding] => 8bit
            [ErrorInfo] => SMTP Error: Could not authenticate.
            [From] => support@qelasy.com
            [FromName] => Qelasy Administrator
            [Sender] => 
            [Subject] => Qelasy Security PIN
            [Body] => Dear Parent,<br /><br />You have successfully registered for Qelasy Security System.<br /><br />Please use this PIN to activate your tablet: <b>34123</b>.<br /><br />Thank you for registering with Qelasy Security System.<br /><br />We value your participation.<br /><br />If you have any questions please call +33 6 9881 1914 or email us at help@qelasy.com.<br /><br />Thank You,<br />Qelasy Security Team
            [AltBody] => 
            [WordWrap] => 0
            [Mailer] => smtp
            [Sendmail] => /usr/sbin/sendmail
            [PluginDir] => 
            [ConfirmReadingTo] => 
            [Hostname] => 
            [MessageID] => 
            [Host] => smtp.gmail.com
            [Port] => 465
            [Helo] => 
            [SMTPSecure] => ssl
            [SMTPAuth] => 1
            [Username] => appmonkeydev@gmail.com
            [Password] => ********
            [Timeout] => 10
            [SMTPDebug] => 
            [SMTPKeepAlive] => 
            [SingleTo] => 
            [LE] => 

            [smtp:PHPMailer:private] => SMTP Object
                (
                    [SMTP_PORT] => 25
                    [CRLF] => 

                    [do_debug] => 
                    [do_verp] => 
                    [smtp_conn:SMTP:private] => Resource id #86
                    [error:SMTP:private] => 
                    [helo_rply:SMTP:private] => 250-mx.google.com at your service, [220.247.236.99]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN
250-ENHANCEDSTATUSCODES
250-CHUNKING
250 SMTPUTF8

                )

            [to:PHPMailer:private] => Array
                (
                    [0] => Array
                        (
                            [0] => azraarshu@gmail.com
                            [1] => 
                        )

                )

            [cc:PHPMailer:private] => Array
                (
                    [0] => Array
                        (
                            [0] => yohan@appmonkeyz.com
                            [1] => Yohan Hirimuthugoda
                        )

                    [1] => Array
                        (
                            [0] => azraar@app-monkeyz.com
                            [1] => Azraar Azward
                        )

                )

            [bcc:PHPMailer:private] => Array
                (
                )

            [ReplyTo:PHPMailer:private] => Array
                (
                    [support@qelasy.com] => Array
                        (
                            [0] => support@qelasy.com
                            [1] => 
                        )

                )

            [all_recipients:PHPMailer:private] => Array
                (
                    [azraarshu@gmail.com] => 1
                    [yohan@appmonkeyz.com] => 1
                    [azraar@app-monkeyz.com] => 1
                )

            [attachment:PHPMailer:private] => Array
                (
                )

            [CustomHeader:PHPMailer:private] => Array
                (
                    [0] => Array
                        (
                            [0] => Cc
                            [1] =>  Yohan Hirimuthugoda <yohan@appmonkeyz.com>
                        )

                    [1] => Array
                        (
                            [0] => Cc
                            [1] =>  Azraar Azward <azraar@app-monkeyz.com>
                        )

                )

            [message_type:PHPMailer:private] => plain
            [boundary:PHPMailer:private] => Array
                (
                    [1] => b1_631af702e0f737dd5c11dcff55e1d8ee
                    [2] => b2_631af702e0f737dd5c11dcff55e1d8ee
                )

            [language:protected] => Array
                (
                    [provide_address] => You must provide at least one recipient email address.
                    [mailer_not_supported] =>  mailer is not supported.
                    [execute] => Could not execute: 
                    [instantiate] => Could not instantiate mail function.
                    [authenticate] => SMTP Error: Could not authenticate.
                    [from_failed] => The following From address failed: 
                    [recipients_failed] => SMTP Error: The following recipients failed: 
                    [data_not_accepted] => SMTP Error: Data not accepted.
                    [connect_host] => SMTP Error: Could not connect to SMTP host.
                    [file_access] => Could not access file: 
                    [file_open] => File Error: Could not open file: 
                    [encoding] => Unknown encoding: 
                    [signing] => Signing Error: 
                    [smtp_error] => SMTP server error: 
                    [empty_message] => Message body empty
                    [invalid_address] => Invalid address
                    [variable_set] => Cannot set or reset variable: 
                )

            [error_count:PHPMailer:private] => 1
            [sign_cert_file:PHPMailer:private] => 
            [sign_key_file:PHPMailer:private] => 
            [sign_key_pass:PHPMailer:private] => 
            [exceptions:PHPMailer:private] => 1
        )

)

Email received from Gmail.

Hi appmonkey, 

We recently blocked a sign-in attempt to your Google Account [appmonkeydev@gmail.com]. 

Sign in attempt details
Date & Time: Tuesday, August 26, 2014 9:23:38 AM UTC 
Location: Colombo, Sri Lanka 

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away. 

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards. 

To learn more, see https://support.google.com/accounts/answer/6010255. 

Sincerely,
The Google Accounts team

解决方案

I oftent faced this problem, GMAIL does not allow to send email using script. Login and check the email you are using in code to see if you get notice of malicious activity on your account. If yes then, I solved this issue by loging in the GMAIL from my HOST and allowing it to send mail using the email.

Not sure this is applicable to your problem

这篇关于phpMailer电子邮件不发送gmail smtp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆