当前位置: 首页 > 知识库问答 >
问题:

无法在用户名为“”的SMTP服务器上进行身份验证yourmail@gmail.com\“使用3个可能的验证器,验证器登录返回预期响应

郭单鹗
2023-03-14

你们能帮我解决这个问题吗!我想通过电子邮件通知确认服务。该电子邮件通过localhost电子邮件google工作。这很好用。但是,当我在服务器(Centos服务器)上托管时,它不工作。我已经将“不太安全的应用程序访问”设置为“开启”。

请帮帮忙

.env文件

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=yourmail@gmail.com
MAIL_FROM_NAME="Test System"
MAIL_PASSWORD=yourpassword@123
MAIL_ENCRYPTION=tls

配置/邮件。php

<?php

返回[

/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/

'default' => env('MAIL_MAILER', 'smtp'),

/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
|            "postmark", "log", "array"
|
*/

'mailers' => [
    'smtp' => [
        'transport' => 'smtp',
        'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
        'port' => env('MAIL_PORT', 587),
        'encryption' => env('MAIL_ENCRYPTION', 'tls'),
        'username' => env('MAIL_USERNAME'),
        'password' => env('MAIL_PASSWORD'),
        'timeout' => null,
        'auth_mode' => null,
    ],

    'ses' => [
        'transport' => 'ses',
    ],

    'mailgun' => [
        'transport' => 'mailgun',
    ],

    'postmark' => [
        'transport' => 'postmark',
    ],

    'sendmail' => [
        'transport' => 'sendmail',
        'path' => '/usr/sbin/sendmail -bs',
    ],

    'log' => [
        'transport' => 'log',
        'channel' => env('MAIL_LOG_CHANNEL'),
    ],

    'array' => [
        'transport' => 'array',
    ],
],

/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/

'from' => [
    'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
    'name' => env('MAIL_FROM_NAME', 'Example'),
],

/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/

'markdown' => [
    'theme' => 'default',

    'paths' => [
        resource_path('views/vendor/mail'),
    ],
],

];

服务器中弹出错误

使用3个可能的身份验证器在用户名为“yourmail@gmail.com”的SMTP服务器上身份验证失败。身份验证器LOGIN返回预期响应代码235,但得到代码“534”,消息为“534-5.7.14”

Gmail

共有1个答案

魏臻
2023-03-14

在回答中,您可以看到。。。请通过web浏览器登录,然后重试 。这表明您进入了OAuth流。在localhost场景中,它可能会起作用,因为您之前已经批准了Gmail OAuth对话框。你必须在谷歌控制台中注册/授权你的应用程序。

看看这里:https://developers.google.com/gmail/api/auth/about-auth

 类似资料:
  • 我试图通过Laravel发送电子邮件。但它正在出错 错误获取: 使用3个可能的身份验证器在用户名为“myEmailID@gmail.com”的SMTP服务器上进行身份验证失败。身份验证器登录返回Swift_TransportException:预期响应代码235,但得到代码“535”,消息“535-5.7.8用户名和密码不被接受”。在535 5.7.8https://support.google.

  • 我正在尝试在我的Laravel 6应用程序中使用smtp电子邮件功能。 有趣的是: 它在我的本地主机中工作正常 它也在我的服务器中工作(没有超文本传输协议) 当我在服务器中应用https时,它停止工作。 它给了我以下错误: 使用3个可能的身份验证器在用户名"*********@gmail.com的SMTP服务器上进行身份验证失败。身份验证器LOGIN返回预期响应代码235,但得到代码“534”,并

  • 我的身份验证系统完全正常工作(我遵循了文档教程)https://symfony.com/doc/current/security/form_login_setup.html). 但我有一个问题:当恶意用户禁用必需的密码字段并尝试登录时,我会收到一个错误500“警告:空密码” 认证系统在一种情况下不起作用: 当用户名与数据库中存储的用户名匹配,但密码为空,并且我尝试登录时,就会出现500 Twig错

  • 它总是导致带有错误消息的catch块 登录失败:未知的用户名或错误的密码。失败:未知的用户名或错误的密码。 我确信给定的密码是正确的。 如何使用给定的密码验证用户名?

  • 问题内容: 以下是我从GoLang获得的MongoDB连接拨号。但是它返回一个紧急消息“ SASL身份验证步骤服务器返回错误:身份验证失败。 ”。我的用户名,密码,hostAddrs和dbName是正确的。我在这里想念什么? 问题答案: 我遇到类似的错误并添加了参数,并且在我们连接到远程MongoDB时可以正常工作 在您的代码中使用以下类似格式:

  • 我试图扩展用户身份验证示例,这里也给出了这个示例,以便多个用户可以登录到服务器。我还想为每个用户分配一个不同的主目录。到目前为止,我还没有找到Apache SSHD API提供的任何此类实用程序,因此我尝试了以下解决方案,使用Apache FTPServer提供的实用程序。 我试图做的是: