after reloading the page its says mail sent successfully but mail is not received by the server I've trie smtp and mail driver at the end i've had no error with sendmail driver but the mail are not received which are send using the laravel
i've go through these links but they dose not gave the sollution.
Check mail is sent successfully or not on Laravel 5
Check mail is sent successfully or not on Laravel 5
Sendmail Subject in Laravel 5.1 these is the code for i write in mail.php
<?php
return [
'driver' => env('MAIL_DRIVER', 'sendmail'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'XXXX@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tsl'),
'username' => env('XXX@gmail.com'),
'password' => env('XXXXXXX'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
?>
here is .env file mail
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=2525
MAIL_USERNAME=XXXXX@gmail.com
MAIL_PASSWORD=XXXXXX
MAIL_ENCRYPTION=tsl
and this is my web.php
try {
Mail::send('mails.name',['name' => "XXXXXX"], function ($message) {
$message->to('XXXXX@gmail.com','hiii')->from('XXXX.com')->subject('XXXX');
});
return "Your email has been sent successfully";
} catch (\Exception $e) {
echo "err";
}