设置用户名而不是电子邮件格式时 SMTP 连接失败

SMTP connection failed when set the username not email format

我正在使用 PHPMailer 发送电子邮件,当我使用不遵循电子邮件格式的用户名设置配置时,它不起作用。我在 outlook 上使用相同的配置进行连接,它工作正常。

"mail" => "smtp",
              "smtp"  => [
                  "host" => "mail.domain.com",
                  "port" => 25,
                  "auth" => true,
                  "secure" => "", // No need for ssl secure here
                  "user" => 'domain\username',
                  "pass" => 'P@$$w0rd'
              ]

我有另一个邮件程序配置,但用户名是 username@domain.com,它工作正常。

我得到的错误是:

> SMTP connect() failed.
> https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

当我升级 PHPMailer 版本时它起作用了。此外,还有服务器问题,他们允许来自 IP 列表之外的请求。