Magento Tutorials

How to Configure SMTP Settings for Sending Emails in Magento

When you don’t want to use Magento default sendmail system, nor some third-party extension for sending emails, then you may want to manually set up external SMTP for your store. This guide will help you configure SMTP settings for outgoing emails in Magento.

In this tutorial, we’ll be using Mageplaza’s SMTP extension. The extension is free and easily configurable, and we highly recommend you use it for the sending of emails for your Magento store.

Installing SMTP extension

The recommended way is to install the extension via composer, as this way provides the best compatibility for your system.

In your Magento root folder, open terminal and run the following commands:

composer require mageplaza/module-smtp
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f


After installing the extension, go to your Magento backend to start configuring the extension for your email sending needs.

In your Magento 2 backend, navigate to: 

Stores > Settings > Configuration > Mageplaza > SMTP

Enable SMTP

Enter your name and email address in order to activate the extension. After which, expand the General Configuration section and set Enable Mageplaza SMTP to Yes.

Enable Mageplaza SMTP

Next, expand SMTP Configuration Options:

SMTP Configuration Options

From here you can configure various essential settings, which is why you’ll want to make sure that you do everything right in the following steps:

Select SMTP provider

In the same SMTP Configuration Options, select a pre-defined SMTP provider by clicking on Load Settings.

Load pre-defined SMTP provider

In the next pop-up you’ll have a list of SMTP providers to choose from. For demonstration purposes, here we’ll be using Gmail as our SMTP provider.

Click on Load Settings. This will load the pre-defined server name and port.

Load pre-defined SMTP provider

Set up email account

Next up, you’ll want to set up the details for your mail account that will be sending all the emails in your store.

set up mail account SMTP

Authentication: set to Login

Username: set to the username name of the Gmail account that you want to be in charge of sending all the emails within your store

Password: enter your app’s password

Google’s app passwords are generated in the following page:

You’ll want to create an app password here and use the generated app password for your SMTP configuration.

Generating an app-specific password for SMTP
Generating an app-specific password for SMTP


All that’s left to do is to test your SMTP configuration. Expand the Send Test Email section and configure the following settings:

Send To: choose from one of the five email senders in Magento. Note that all emails will still be sent from the email address which you just configured above, and selecting different roles will only affect the sender’s name (e.g., Owner, Sales, Customer Support, etc)

Send from: select the destination email address

With proper configuration, you should be able to see this:

Test email sent successfully

And when going to the recipient’s inbox to check the test email, you should see something like this:

Test email SMTP Magento

Congratulations! You have successfully configured SMTP for your Magento store.

See also:
Magento Emails Not Sending
How to customize your Magento Email Templates


A knowledge craver who always strive to be wiser everyday.

Notify of

Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Chandrasekhar Sah
Chandrasekhar Sah
1 year ago

Magento 2 SMTP Extension is an email marketing solution that supports every important SMTP provider to solve problems such as spamming, HTML/plain text in emails, and more. Magento 2 SMTP Extension also assures that your emails are delivered using traditional mail protocols. Plus, it encourages you to seamlessly set up email SMTP with any host.

You can contact us for an SMTP installation guide and support.

backpack battles
2 months ago

Thanks for providing detailed instructions on how to set up SMTP settings using the Mageplaza SMTP extension for Magento.