Laravel - Connection could not be established with host smtp.gmail.com [ #0]

后端 未结 13 573
无人及你
无人及你 2020-12-29 04:32

I\'m trying to send an email from Gmail using Laravel from localhost. I\'m getting this error: Connection could not be established with host smtp.gmail.com [ #0]

I\'

相关标签:
13条回答
  • 2020-12-29 05:21

    If you are using Amazon EC2, do ensure to set outbound rules for SMTP (25) and SMTPS (465) to Anywhere.

    MAIL_MAILER=smtp
    MAIL_HOST=smtp.googlemail.com
    MAIL_PORT=465
    MAIL_USERNAME=yourgmailemail@gmail.com
    MAIL_PASSWORD='yourgmailpassword'
    MAIL_ENCRYPTION=ssl
    MAIL_FROM_ADDRESS=yourgmailemail@gmail.com
    MAIL_FROM_NAME="${APP_NAME}"
    ```
    
    
    
      [1]: https://i.stack.imgur.com/Q9rAn.png
    
    0 讨论(0)
提交回复
热议问题