I need to sent mail from localhost but can't able to do.


4 Answers 4


For send email from localhost use SMTP extension for Magento 2

Step to configure extension :

  • Download from Magepal Gmail smtp
  • Run php bin/magento setup:upgrade
  • Go to Store > Configuration > Advanced > System > SMTP configuration & settongs
  • You can send test mail from configuration after all configuration done.

That's all done!

  • Thanks for your response, It's works well
    – Sakthivel
    Commented May 17, 2019 at 6:48
  • You are welcome :) Commented May 17, 2019 at 6:55

Magento 2 provides an easy way to set custom SMTP to send emails from the localhost.

To configure it, go to Stores >> Configuration >> DOTMAILER >> Transactional Emails section, and set the following values:

  • Enabled - Yes
  • Host - {Your SMTP Host}
  • Username - {Your Email Username}
  • Password - {Your Email Password}
  • Port - {SMTP Port Number}

Please let me know if you find any problem.


I usually use MagePal Gmail SMTP to send the email.

And use MailHog if only need to test the mail in localhost


If you are using Ubuntu/Linux then following link will help


Follow these steps even i have configured it this way

Not the answer you're looking for? Browse other questions tagged or ask your own question.