Laravel Homestead Swift Cannot send message without a sender address

前端 未结 14 1023
予麋鹿
予麋鹿 2020-12-08 19:09

I get this error with stock email settings in Laravel 5.1 Homestead when I try to send a password reset mail.

Swift_TransportException in AbstractSmtpTransp         


        
14条回答
  •  我在风中等你
    2020-12-08 19:40

    In Laravel 7 , your .env file should be like this

    MAIL_MAILER=smtp
    MAIL_HOST=smtp.mailtrap.io
    MAIL_PORT=2525
    MAIL_USERNAME="your username"
    MAIL_PASSWORD="your password"
    MAIL_ENCRYPTION=tls
    #MAIL_FROM_ADDRESS=null
    #MAIL_FROM_NAME="${APP_NAME}"
    

    Make sure these two lines are commentout like this...

    #MAIL_FROM_ADDRESS=null
    #MAIL_FROM_NAME="${APP_NAME}"
    

    Final step: run these step of command in your terminal to successfully send notification -

    php artisan config:cache
    php artisan cache:clear 
    php artisan config:clear
        
    

提交回复
热议问题