Laravel send email, configuration and send script

前端 未结 1 589
无人及你
无人及你 2021-01-26 05:31

I have a problem with my laravel email client. I need to send email by click button.

my code: .env

MAIL_DRIVER=smtp
MAIL_HOST=mail.somedomain.com
MAIL_PO         


        
相关标签:
1条回答
  • 2021-01-26 06:17

    In Gmail account

    My account > Sign In And Security > Sign In to google, enable two step verification

    • http://i.prntscr.com/7c849cb520e84f02b39216f3662590bc.png
    • http://i.prntscr.com/cc52e9b8e7c2472496f1e2d2ec8185f8.png

    Create One App and generate password

    • http://i.prntscr.com/b38cdca0724446d8a53b22dfa5f43ee6.png

    In your .env file

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=587
    MAIL_USERNAME=myemail@gmail.com
    MAIL_PASSWORD=apppassword // this is created from gmail app password
    MAIL_ENCRYPTION=tls
    

    And Then run php artisan config:cache

    0 讨论(0)
提交回复
热议问题