I have tried this.
<?php
return array(
'driver' => 'smtp',
'host' => 'smtp.sendgrid.net',
'port' => 587,
'from' => array('address' => 'from@example.com', 'name' => 'John Smith'),
'encryption' => 'tls',
'username' => 'sendgrid_username',
'password' => 'sendgrid_password',
);
Mail::send('emails.demo', $data, function($message)
{
$message->to('jane@example.com', 'Jane Doe')->subject('This is a demo!');
});
But i am getting this error:
Failed to authenticate on SMTP server with username "sendgrid_username" using 2 possible authenticators
How to resolve this problem.
Please help me.