在处理一个使用PHPMailer来发送电邮,我在本地使用个人163邮箱来作测试发送电邮,可以成功的发送电邮;当上传到正式平台时,出现了,相似这样的错误信息php
SMTP ERROR: Password command failed: 535 Incorrect authentication data ,SMTP connect() failed.
在2015-03-03下午时,接近下班的时候,我在测试出现的,怎么也发送不了邮件,当时个人PHPMailer的SMTPDebug是设置为1的。服务器
到了2015-03-04上午上班时,我也不清楚该如何处理时,我就点击PHPMailer的examples,在sublime text2点击每一个*.phps打开预览里面的code,我在"examples/smtp.phps" 中看到SMTPDebug的注释测试
//Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 2;
对了,昨天我设置为1,只能看到"SMTP ERROR: Password command failed: 535 Incorrect authentication data"的消息this
将SMTPDebug设为2时,我能够看到debug消息中,多了"We do not authorize the use of this system to transport unsolicited"这个消息,大概的意思是:咱们没有委托本系统之外的未受权的服务来转发邮件。spa
最后笔者尝试使用服务器(空间)上面的一个电邮账号来发送电邮,具体的smtp的资料,须要你看本身服务器(空间)的电邮(email)资料.笔者使用服务器(空间)上面的一个电邮帐户来发送邮件,能够发送成功了。如个人网址:www.exapmle.com,能够使用username@example.com的帐户来发送电邮。debug