Hi there I want to send an email using laravel. In localhost every thing is fine what in heroku its gives Failed to authenticate on SMTP server with username "mail@gmail.com" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "534"
I have added .env variables in settings as well
here is code
.env
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=mail@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=mail@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
controller
Mail::send('email', array(
'name' => $request->name,
'email' => $request->email,
'phone' => $request->phone_number,
'gender' => $request->gender,
'institute' => $request->institute
), function($message) use ($request){
$message->from($request->email);
$message->to('mail@gmail.com')->subject($request->get('Apply Form'));
});