php - How to send email in laravel -


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 demo!'); }); 

but getting error:

failed authenticate on smtp server username "sendgrid_username" using 2 possible authenticators 

how resolve problem.

please me.

make sure settings ok, username , password correct, function should work posted.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -