Php 验证器登录返回了预期的响应代码235,但得到了代码“;535;,带“信息”;535不正确的身份验证数据“;
您好,我正在尝试在laravel中发送电子邮件。但当尝试发送时,它会生成以下错误,并且邮件不会发送。但是在localhost中,一切都很好,没有任何问题Php 验证器登录返回了预期的响应代码235,但得到了代码“;535;,带“信息”;535不正确的身份验证数据“;,php,laravel,Php,Laravel,您好,我正在尝试在laravel中发送电子邮件。但当尝试发送时,它会生成以下错误,并且邮件不会发送。但是在localhost中,一切都很好,没有任何问题 Failed to authenticate on SMTP server with username "lifeloveandotherthings94@gmail.com" using 2 possible authenticators. Authenticator LOGIN returned Expected response co
Failed to authenticate on SMTP server with username "lifeloveandotherthings94@gmail.com" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 Incorrect authentication data
". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 Incorrect authentication data"
以下是我在.env中的代码
MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=MyEmailPassword
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=noreply@lifelove.com
MAIL_FROM_NAME='LifeLoveAndOtherThings'
我没有在config/mail.php中添加附加代码
'stream' => [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
],
我没有在config/mail.php中更改或添加电子邮件。我只在.env文件中进行了设置。这里有什么问题。我有一个类似的错误,我输入了我的密码,它工作得很好
MAIL_PASSWORD="YourEmailPassword"
如果问题仍然存在,请尝试使用双引号中的用户名、密码和端口号
如果您正在使用您的个人Gmail帐户,请按照以下步骤操作:
祝你好运 您是否在您的google帐户安全策略中启用了“允许不太安全的应用”?这个gmail id是否启用了双因素身份验证?是的,我已经启用并生成了应用程序密码。你的密码是否有特殊字符?如果是,请用双引号括起来,如->MAIL_PASSWORD=“MyEmailPassword”@Rajesh,如果此解决方案有效,则应将其标记为正确。这对我有用!