This question already has an answer here:

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

Please give me your suggestions, how configure it.

Thanks in Advance

marked as duplicate by Manashvi Birla, Dhiren Vasoya, saravanavelu, sv3n, Shoaib Munir May 16 at 12:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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 > Afvanced > 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 May 17 at 6:48
  • You are welcome :) – Chirag Patel May 17 at 6:55

I usually use MagePal Gmail SMTP to send the email.

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


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.


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.