PHP Swift mailer: Failed to authenticate on SMTP using 2 possible authenticators

前端 未结 13 937
不思量自难忘°
不思量自难忘° 2020-12-14 07:41

When I send an email with the PHP Swift mailer to this server: smtp.exchange.example.com like this:

// Load transport
$this->transport =
    Swift_SmtpTra         


        
相关标签:
13条回答
  • 2020-12-14 08:13

    The server might require some kind of encryption and secure authentication.
    see http://swiftmailer.org/docs/sending.html#encrypted-smtp

    0 讨论(0)
  • 2020-12-14 08:15

    I just received the same error.

    The strange thing is that commented the credential lines

    // ->setUsername(self::$config->username)
    // ->setPassword(self::$config->password)
    

    And the problem disappeared.

    I'm puzzled because the mail server definitely needs those credentials.

    0 讨论(0)
  • 2020-12-14 08:17

    Strange enough sending emails works again. We did not change anything and the host say they did not either. We think a server restarts or so. It is strange :S

    0 讨论(0)
  • 2020-12-14 08:20

    I faced the same problem and solved it. Try to log in manually to your gmail account first. This issue is due to google has detected your gmail account has been abusing. E.g send a lot of emails over a short period of time.

    0 讨论(0)
  • If you are trying to send mail from your local enviroment eg. XAMPP or WAMP, this error will occur everytime, go ahead and try the same code on your web hosting or whatever you are using for production.

    Also, 2 step authentication from google may be the issue.

    0 讨论(0)
  • 2020-12-14 08:23

    You perhaps use the wrong username.

    I had a similar error. Ensure you're not using uppercase while logging into server.

    Example: JacekPL@lala.pl

    If you use ->setUsername('JacekPL'), this can cause an error. Use ->setUsername('jacekpl') instead. This solved my problem.

    0 讨论(0)
提交回复
热议问题