By default, Magento 2 uses the PHP Mail function to send out emails. If you have already configured server-wide SMTP settings, no further configurations are required. This KB is intended for users who prefer to use a Magento extension for managing SMTP settings. For the purpose of this KB, we will use Mageplaza’s Magento 2 SMTP extension.
Before proceeding, please ensure that your Magento version is supported by this extension. To check the supported versions, click here. If you only want to set a different “From Name” and “Sender Email” for your Magento store, check the last section of this KB.
How to Configure Mageplaza SMTP Email Extension on Magento 2.x
Step 1: Download Mageplaze SMTP Extension
Log into Magento Marketplace using your Magento Admin credentials.
Enter SMTP by Mageplaza in the search bar, and from the results, click Mageplaza SMTP.
Now, select your store version ( in this case, Magento 2.x) and click the Add to Cart button.
You will receive the confirmation message.
Next, go to My Profile and copy the Public and Private keys from the Access Keys section. These keys will be required while installing the extension.
Step 2: Log in to the Magento Admin Panel
Log into your Magento Admin Panel and navigate to System > Tools via the sidebar and then click Web Setup Wizard.
Step 3: Install Mageplaza SMTP Extension
Note 1: Before proceeding any further, it is highly recommended to reset permissions of your Magento application from your Cloudways Platform to avoid any issues.
Note 2: Take an on-demand backup of your Magento application to ensure quick recovery in case anything goes wrong.
From the Setup Wizard screen, select Extension Manager.
Enter your Magento Marketplace Public and Private keys and then click Submit.
If your Magento Marketplace Account is already connected, you will see the below screen. Click the Review and Install button.
Now in the list on the Extension Manager screen, locate ‘mageplaza/module-smtp’ and click the Install button.
Next, click Start Readiness Check.
The process will take a few moments. Click Next to continue.
If you have already taken an on-demand backup on your server, you can safely skip the backup step. For this, uncheck all three backups options and click Next to proceed.
Click Install to start the process.
The process will take a few minutes to complete.
Step 4: Activate Mageplaza SMTP Extension
On the Magento Admin Dashboard, navigate to Store > Settings > Configuration. Click SMTP under the Mageplaza Extensions sub-menu.
Enter your name and email address, and then click Activate Now button.
Step 5: Configure Mageplaza SMTP Extension
From the SMTP Provider dropdown menu, choose your preferred provider, and then click the Load Settings button. Now, enter the username and password of your selected email service provider and click the Save Config button.
For convenience, SendGrid is selected as an example.
You will receive the following success message.
Step 6: Verify SMTP Settings
After the SMTP settings have been configured, it’s important to send a test email to ensure that everything is working properly.
For this, click to expand Send Email Test under the SMTP section of the Mageplaza Extensionssubmenu. Select Send Form from the dropdown menu and then enter the target email address in the Send To field.
Click Test Now to send a test email to the provided email address.
Check the inbox to verify that you have received the test email.
Configure Sender Name and Email Address (Optional)
If you haven’t set Sender Name and Sender Email for your store or wish to change the current values, go to Stores > Settings > Configuration.
Under the Configuration page, choose your store from the Store View. Under General, click Store Email Addresses, expand General Contact, unselect ‘Use system Value’, and then set the preferred Sender Name and Sender Email values.
How to Add an SPF Record at Domain Registrar (Recommended)
To avoid any issues with the outgoing emails, we highly recommend adding an SPF record about your preferred email service provider at your Domain Registrar.
For this, log into your Domain Registrar. Navigate to Domain Management and then add a new record with the following values:
Host: Enter your server public IP address
TEXT Value: Add SPF record as per your SMTP service provider’s recommendation.
TTL: Choose the lowest value
Click Save to apply the settings.