How to configure Laravel mail.php to use built-in mail function?

后端 未结 4 1272
花落未央
花落未央 2020-12-13 07:25

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

4条回答
  •  天涯浪人
    2020-12-13 08:02

    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
    

提交回复
热议问题