I'm working on a module which sends emails from admin panel on some action. I want to test these emails on localhost. How can I configure my Magento 2.1 settings or add SMTP
so that sends emails over localhost?
-
Have installed SMTP Pro extension for it ?– Suresh ChikaniCommented Oct 21, 2016 at 8:25
-
3Possible duplicate of How to send Mails from localhost using gmail and SMTP Pro Magento– Teja Bhagavan KolleparaCommented Oct 21, 2016 at 8:27
-
below solutins not working?– Rakesh JesadiyaCommented Oct 21, 2016 at 9:51
-
The above link is getting some error. ![enter image description here](i.sstatic.net/IpnBG.png)– sdeveloperCommented Nov 20, 2018 at 10:22
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review– Manashvi BirlaCommented Nov 20, 2018 at 11:15
3 Answers
If highest voted answer's repo doesn't show up than you can use below free extension by MagePlaza to send emails on xampp.
You can use the SMTP
for this.
And for SMTP
configuration you can use any extension.
https://github.com/emizentech/custom-smtp-magento2
From this extension you can configure your SMTP
detail in admin and based on that you can send email from local system
-
i am getting this No connection could be made because the target machine actively refused it. after installation Commented Feb 22, 2017 at 12:21
-
-
@ErSarveshVTiwari ... take a look at github.com/magepal/magento2-gmailsmtpapp/issues/12 Commented Jun 15, 2017 at 11:45
-
2Unfortunately the repository in the answer has been the subject of a DMCA takedown and is no longer available. Commented Jun 28, 2017 at 11:05
-
7The URL does is not valid anymore. That's why StackExchange encourages to put full answers here rather than URLs and links. Links get broken and content gets removed. Commented Jul 24, 2017 at 4:20
You can also use ssmtp. This can be configured to work with gmail.
In Gmail you need to configure your account to allow less secure apps.
https://support.google.com/accounts/answer/6010255?hl=en
To install ssmtp with stock Ubuntu enter:
sudo apt-get install ssmtp
Then you need a basic setup for your /etc/ssmtp/ssmtp.conf
, for example:
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
[email protected]
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
AuthMethod=LOGIN
[email protected]
AuthPass=Alderaan
UseTLS=YES
UseSTARTTLS=YES
# Where will the mail seem to come from?
rewriteDomain=gmail.com
# The full hostname
hostname=DeathStar
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
root:[email protected]:smtp.gmail.com:587
This will now enable you to have your emails work in Magento2 including for the newsletter send.
This approach also allows you to run a stock demo store on your localhost without any third party modules for SMTP delivery.
Configuration of your email sending can therefore be de-coupled from your Magento build making testing and deployment simpler.