Error Expected response code 250 but got code "550", with message "550 This is a submission only port. You must authenticate before sending mail

10,943

If you want to send an e-mail via Gmail then you need to verify your Gmail account with 2 step verification and generate mail password. for verifying your Gmail account to throw this link enter link description here after verifying your account go to "security->app password" generate mail password. select app "mail" and select device "window computer" copy the generated password paste into your .env file

Your .env file show look like:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls

After saving your.env file, remove project config and cache with the command

php artisan config:cache
php artisan cache:clear

For sending an email via Domain follow this link enter link description here

Share:
10,943
Jignesh Mistry
Author by

Jignesh Mistry

Updated on June 04, 2022

Comments

  • Jignesh Mistry
    Jignesh Mistry almost 2 years

    I have the centos server with laravel setup. I am facing issue while sending email from server. My laravel version is 5.8.29 and PHP version is 7.3.6. I am using SMTP to send email. Guys please do help me out. Here are my code.

    It's very strange to say that from my local setup from my system I am able to send email with same SMTP details with current project setup with same code. But some how on production server the emails are not sending. I have cross checked with swift mailer and tested with separate file for only email send and its work. But from actual environment is not work.

    .env file

    MAIL_DRIVER=smtp
    MAIL_HOST=mail.domain.com
    MAIL_PORT=587
    mail_username=username
    MAIL_PASSWORD=password
    MAIL_ENCRYPTION=tls
    

    Email should be send from the environment file

    • Ghiffari Assamar
      Ghiffari Assamar over 4 years
      try php artisan config:clear after editing .env value and try change mail port to 465, 25 or 2525
    • Jignesh Mistry
      Jignesh Mistry over 4 years
      @GhiffariAssamar Thanks It fixed now. I came to know after so much debug that the credential details are not loading from .env file. It's fixed now.
    • Ghiffari Assamar
      Ghiffari Assamar over 4 years
      glad to hear it :)
  • Jignesh Mistry
    Jignesh Mistry over 4 years
    Its fixed now as mention in above comment the credential was not loading from .env file. I have fixed that. And it's working now.
  • Rohit Agrohia
    Rohit Agrohia over 4 years
    Great @JigneshMistry