Issue
I need to send an email via the mail()
PHP function.
I've read somewhere that I have to change driver
parameter in config/mail.php
to sendmail
.
By default, it looks like this:
'driver' => env('MAIL_DRIVER', 'smtp'),
Now, it looks like this:
'driver' => 'sendmail',
Also tried this:
'driver' => 'mail',
But still, the mail()
function doesn't work. What do I need to change?
Solution
You can set your mail configuration .env
file like
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=youremail@gmail.com
MAIL_PASSWORD="password"
MAIL_ENCRYPTION=tls
also set configuration in config/mail.php like:
'from' => ['address' => 'youremail@gmail.com', 'name' => 'Test'],
then you can clear the cache:
php artisan config:cache
php artisan cache:clear
Answered By - AddWeb Solution Pvt Ltd Answer Checked By - Katrina (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.