2

I've configured to gmail SMTP server to send email. Account less secure app turned ON, also Recapture enabled. Here is the mail.php configuration.

This code working fine on local server. But when i tried to in godaddy server i saw the following Error :

 (1/1) Swift_TransportException Failed to authenticate on SMTP server
 with username "[email protected]" using 2 possible authenticators in AuthHandler.php (line 181)

.env (mail part)

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=xxxxxx
MAIL_ENCRYPTION=tls

Mail.php

return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.gmail.com'),
    'port' => env('MAIL_PORT', 587),
    'from' => [
    'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
    'name' => env('MAIL_FROM_NAME', 'xxxx'),
    ],


    'encryption' => env('MAIL_ENCRYPTION', 'TLS'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => false,

What should I do now?

User57
  • 2,453
  • 14
  • 36
  • 72

2 Answers2

0

This is an old thread, but my resolution was a bit different for the same error. Turns out my Swift configuration is fine. The IP from my server was blocked by Google as suspicious. I was able to clear it by visiting this link, then executing my mailer code from the server. http://www.google.com/accounts/DisplayUnlockCaptcha

0

Sorry, I know this is an old thread but i came across a similar issue with GoDaddy SMTP with the Laravel application running on AWS EC2. The below code works for me maybe it will help you guys too.

MAIL_DRIVER=smtp
MAIL_HOST="relay-hosting.secureserver.net"
MAIL_PORT=25
MAIL_USERNAME="<[email protected]>"
MAIL_PASSWORD="<your_password>"
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="${APP_NAME}"
MAIL_FROM_ADDRESS="<[email protected]>"