I am developing an API in laravel Lumen 5.4 and I am stuck in sending mails i.e to send a mail when a new user signup and so on different operations.
my mail sending Function is
use App\config\maill;
use App\config\services;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Mail;
use Illuminate\Contracts\Mail\Mailer;
public function basic_email()
{
$data = array('name'=>"ahmad");
Mail::send(['hiii'],$data, function($message) {
$message->to('ahmadbinizhar@gmail.com', 'welcome')->subject('Laravel Basic Testing Mail');
$message->from('a*****d@gmail.com','ahmad');
});
return response('Basic Email Sent. Check your inbox');
}
My Route is
$app->get('sendbasicemail','UserController@basic_email');
My .Env File is
MAIL_DRIVER = smtp
MAIL_HOST = smtp.gmail.com
MAIL_PORT = 587
MAIL_USERNAME = a*******d@gmail.com
MAIL_PASSWORD = ThisIsNotSecret
MAIL_ENCRYPTION = tls
i have check through mailgun Driver also but the same error .
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire