Answer the question
In order to leave comments, you need to log in
How to solve the problem of sending mail using gmail in laravel?
Greetings!
I wanted to send mail, but an error occurs.
Failed to authenticate on SMTP server with username "*******@gmail.com" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535-5.7.8 Username and Password not accepted.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_ENCRYPTION=ssl
MAIL_USERNAME=*****@gmail.com
MAIL_PASSWORD=************
class FeedbackShipping extends Mailable
{
use Queueable, SerializesModels;
public $feedback;
public function __construct(Feedback $feedback)
{
$this->feedback = $feedback;
}
public function build()
{
return $this->from('............')
->to('............')
->view('emails.feedback');
}
}
public function send(Request $request)
{
$data = new Feedback(
$request->get('name'),
$request->get('phone')
);
Mail::send(new FeedbackShipping($data));
return response()->json(['send' => 'ok']);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question