skip to Main Content

When i try to send mail using Laravel but error occurring
like this

"Connection to "process /usr/sbin/sendmail -bs -i" has been closed unexpectedly."

enter image description here

this is my env

`MAIL_MAILER=sendmail
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=567
MAIL_USERNAME=*******.com
MAIL_PASSWORD="******"
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="********.com"
MAIL_FROM_NAME="${APP_NAME}"`

..

2

Answers


  1. This might be the solution.

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=465
    MAIL_USERNAME=**YOUR_GMAIL_EMAIL**
    MAIL_PASSWORD=**GENERATED_APP_PASSWORD**
    MAIL_ENCRYPTION=ssl
    

    On https://myaccount.google.com/apppasswords you can create an app password.

    Login or Signup to reply.
  2. It will be nice if you could test your email locally using mailtrap.io first. If everything is ok on your local, make sure you gmail account could send SMTP emails.
    https://help.accredible.com/smtp-setup-in-gmail-inbox

    Also change you config to

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=465
    MAIL_ENCRYPTION=ssl
    MAIL_USERNAME=<youremail>
    MAIL_PASSWORD=<yourpassword>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search