Am trying to send email by Laravel.
But It's getting error.
.env file Configuration below :
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls
Controller Code Below :
$data = array('name'=>"Ripon Uddin", "body" => "Test mail");
Mail::send('email', $data, function($message) {
$message->to('[email protected]','To My Yahoo')->subject('Laravel Test Email');
$message->from('[email protected]','Ripon Uddin (Laravel Lover)');
});
Error gettings :
Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials r18-v6sm7406256pgv.17 - gsmtp " in






php artisan config:cacheto recache .env