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
To use the email server running on localhost
, your .env
file should look like this (The PHP mail
function doesn't need a username or a password)
MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null
Then, update the configuration cache:
php artisan config:cache