The Most Popular Extension Builder for Magento 2

With a big catalog of 224+ extensions for your online store

Magento 2 Email Settings: Configure SMTP in 3 Easy Steps

May every online merchant have been familiar with the email sending system. In this post, I want to give general guidelines over how to configure Magento 2 email settings. Unlike the SMTP module the setting for default SMTP mode is quite complicated for newbies. However, I hope that this guideline will help you have a deeper understanding about the Magento SMTP Email settings. SMTP, an acronym for Simple Mail Transfer Protocol Protocol, is a standard email-sending system first introduced in the late 20th century. There are 3 steps to set up SMTP in Magento 2 as follows.


SMTP

SMTP Extension for Magento 2

Prevent your emails for customers from going to the SPAM box

Check it out!


Magento 2 Email Settings Overview

Extension Configuration

The extension configuration offers extensive options to fine-tune your email system to your store’s needs. It includes updating the sender’s email details to match your brand, configuring the SMTP server for dependable email delivery, managing email logs for effective monitoring and troubleshooting, and enhancing SPF records to boost email deliverability and minimize spam.

It is necessary to ensure these settings are accurately configured so customers can get their full order confirmations and other important notifications without any issues.

General Settings

In the general settings of Magento 2 Email Settings, you have the ability to customize your email setup effectively:

  • Set Sender Information: Define the from address for outgoing emails.

  • Enable Log Clearing: Automate the clearing of email logs to maintain a clean database.

  • Manage Blacklisted Emails: Prevent unwanted emails from being sent or received by managing a blacklist.

  • Access Logs for Troubleshooting: Review email logs to resolve any issues that arise.

  • Configure SPF Records: Set up SPF records to authenticate your emails and improve security.

  • Handle Email-Related Cron Tasks: Schedule and manage cron jobs related to email sending and receiving.

These settings not only offer the flexibility to adjust your email interactions but also ensure the smooth functioning of your Magento store’s email system.

SMTP Basic Configuration

Configuring SMTP for Magento 2 is essential for ensuring that your store’s emails are sent out reliably and securely. Here’s a detailed guide on how to set up the SMTP Basic Configuration:

  • Navigate to Stores > Settings > Configuration > Mageplaza extensions in the Magento admin panel.

  • Click SMTP settings, then input your SMTP server name and port number.

  • Find the file on your server: app/code/core/Mage/core/Model/Email/Template.php.

  • Enable the module if it’s not already active.

  • Open the Template.php file and locate the getMail() function.

  • Make the following changes to configure the SMTP settings:

php
public function getMail()
{
    if (is_null($this->_mail)) {
        /* Changes Begin */
        $mySmtpHost = Mage::getStoreConfig('system/smtp/host');
        $mySmtpPort = Mage::getStoreConfig('system/smtp/port');
        $config = array(
            'port' => $mySmtpPort,
            'auth' => 'login',
            'username' => '[email protected]',
            'password' => 'yourpassword'
        );
        $transport = new Zend_Mail_Transport_Smtp($mySmtpHost, $config);
        Zend_Mail::setDefaultTransport($transport);
        /* Changes End */
        $this->_mail = new Zend_Mail('utf-8');
    }
    return $this->_mail;
}

By following these steps, you’ll have a basic SMTP configuration that allows your Magento 2 store to send emails through the SMTP protocol, which is widely used for its reliability and security features.

Besides, when setting up your Magento 2 store’s email system, you have the option to use either the localhost or a custom SMTP server. If you decide on a custom server, it’s necessary to input the complete hostname, port number, and authentication details. Make sure to save these settings and conduct a test by sending a test email to verify the configuration.

This fundamental basic is critical to achieving dependable and secure email transmission through the Simple Mail Transfer Protocol (SMTP).

Sender Email Update

To update the sender’s email, follow these steps:

Store email addresses

  • Navigate to the backend of your website and log in to your Magento admin panel.

  • Proceed to Stores > Settings > Configuration.

  • Click on Store Email Addresses under the General tab

  • Locate the General Contact section, which is used for customer inquiries, product information, and partnership offers, and then update the following fields:

Sender Name: Enter the name of the sender who will be responsible for all outgoing emails from this specific General Contact email address.

Sender Email: Provide the email address that will be used to send emails from this General Contact. Save configuration

Note: For consistency, use an email address matching your store’s domain.

Furthermore, maintaining up-to-date information can enhance email acceptance rates and build customers’ trust.

Blacklist Email

Magento 2 email settings include the blacklist feature. It is a helpful feature designed to enhance the security and integrity of your store’s email communication system. By allowing you to blacklist specific email addresses, Magento 2 ensures that emails from these sources are automatically filtered out and not processed. This is particularly useful for preventing spam and unauthorized access, as it allows store owners to manage and control the flow of incoming emails proactively.

How to Implement the Blacklist Feature:

Blacklist feature

  • Log into your Magento 2 admin panel.

  • Navigate to Stores > Settings > Configuration > Mageplaza > SMTP

  • Click General Configuration sections

  • Identify the customer whose email address or IP you wish to block.

  • Add an email address or IP to the blacklist; you prevent any emails from these sources from reaching your store or your customers.

  • Save configuration. This action will activate the blacklist and start protecting your store from the specified addresses.

SPF Record Configuration

Configuring an SPF (Sender Policy Framework) record is vital for the integrity of your email delivery system. It helps in authenticating your sent emails and safeguards your domain’s reputation by preventing emails from being marked as spam.

To set up your SPF record, follow these steps:

  • Navigate to your domain’s DNS settings.

  • Insert a TXT record that records the IPs or domains authorized to send emails on your domain’s behalf.

For accurate SPF record setup, it’s advisable to consult with your e-commerce hosting provider or IT team. They will guide you on the specific required format and values needed for the TXT record. After obtaining the correct information, promptly update your DNS settings to ensure consistent and reliable email delivery.

Automatic Clear Log

The Automatic Log Clearing function within Magento 2 Email Settings helps you autonomously delete outdated log files so you can save time. It not only ensures that your email logs remain current but also conserves storage space by eliminating unnecessary data. Therefore, it’s an efficient tool that simplifies maintenance and contributes to the seamless operation of your Magento 2 email configurations.

Debug Log

The Magento 2 debug log records errors that occur while sending emails. It offers detailed error information to help with efficient problem-solving.

By examining the debug log, you can identify problems with your email configurations, SMTP settings, and other related aspects. This review process is crucial for maintaining uninterrupted and effective email communication with customers. Additionally, it keeps you informed about any potential issues, allowing for fast action to maintain email operations.

Cron Tasks List

In Magento 2, cron tasks automate processes that handle essential operations, including sitemap generation, currency rate updates, and email dispatching.

To check the list of Magento 2 cron jobs, you can use the command line to execute bin/magento cron:install. This command will show all the tasks scheduled on your site, helping you ensure that your website runs efficiently and without errors. Quickly resolving any problems is crucial to maintaining the optimal performance and functionality of your Magento 2 website.

Magento 2 Email Settings: Steps to Configure SMTP

Step 1: Create an email address for your domain

This is the first step in our guide on Magento 2 email settings. Before a store admin can start configuring SMTP email for the Magento store, the store admin needs to obtain a valid email address for his domain. Admins can set up email addresses by following guidelines from the server administrator or email hosting provider. Therefore, this very first step is also called the SMTP email setting for Magento 2.

  1. Access your Hosting Control Panel

  2. Navigate to Email Accounts section

Navigate to email Accounts section

  1. Create a New Email Address

Enter the desired username

  • Enter the desired username for your email address

  • Set a password for this email address

Set a password Save and verify your mail

Step 2: Setup the Email sending system for Magento stores

To set up the email transmission system for Magento stores, which includes configuring SMTP, adhere to these steps within your Magento 2 admin panel:

  1. Log in to your Magento admin panel located in the backend of your website.

  2. Go to Stores > Settings > Configuration.

  3. On the left-hand side, under the General section, choose Store Email Addresses.

  4. In the General Contact area (utilized for inquiries, product details, and collaboration proposals), make the following modifications:

  • Under General Contact > Sender Name, input the name of the sender responsible for all messages sent from this particular General Contact email.

  • Under General Contact > Sender Email, provide the associated email addr

General contact

Repeat these adjustments for the Sales Representative and Customer Support sections.

Please note: If you are using Custom Email, ensure that the content reflects the correct sender’s identity.

Sales representative

Step 3: Keep your Sales Email Configuration up-to-date

The last step for Magento 2 email settings is updating the Sale Email configuration. No one appreciates receiving delayed sales-related emails, particularly those related to order confirmations or tracking details. In this guide, we’ll explain how to ensure your Magento store maintains an up-to-date sales email setup.

  1. Log in to Magento Admin Panel > Stores > Configuration > Sales > Sales Email

Sales emails

  1. Choose Ordercarefully and thoroughly inspect all sender details for accuracy

  2. Click the Save Config to apply the changes

How to Set Up Magento 2 Email SMTP Setup

Step 1: Enable the SMTP extension

Enter configuration

Step 2: Set up SMTP configuration options

  • Begin by choosing a reliable SMTP provider for Magento. Click on the Load Settings button next to the Host field, then a popup about SMTP Providers will be displayed.

Select SMTP provider

  • Pick your preferred provider

  • Enter the username and password provided by your selected email service provider

Username and password

  • Click the Save Config button

  • You will receive a confirmation message: You saved the configuration.

Step 3: Verify SMTP Settings

To verify the functionality of your SMTP settings within Magento 2, move to the Send Test Email section and follow these steps:

Send test email

  1. Choose the sender group

  2. Enter the recipient's email address

  3. Click Test Now to send a test email

  4. Check your inbox for the test email confirmation

Conclusion

Magento 2 Default SMTP is introduced with the aim of supporting store owners in accessing more customers and increasing sales. However, many shop admins do not know that most of their emails were left silently in spam or outbox instead of customers’ inboxes. That is the biggest limitation of default SMTP making it become ineffective for any e-commerce.To overcome this, consider integrating a reliable email verifier alongside the Magento 2 SMTP extension, ensuring your e-commerce emails reach their intended audience, and maximizing the effectiveness of your email marketing efforts. If you have any questions about the guide above for Magento 2 email settings, don’t hesitate to contact us.


SMTP

SMTP Extension for Magento 2

Prevent your emails for customers from going to the SPAM box

Check it out!


Related Posts

Image Description
Sam is the CEO & co-founder of Mageplaza, a company established to support Magento merchants with different powerful tools and resources. Sam Nguyen is also the CEO & founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore – aiming to support more than a million online businesses to grow and develop.
Website Support
& Maintenance Services

Make sure your store is not only in good shape but also thriving with a professional team yet at an affordable price.

Get Started
mageplaza services
x

    People also searched for

    Subscribe

    Stay in the know

    Get special offers on the latest news from Mageplaza.

    Earn $10 in reward now!

    Earn $10 in reward now!

    comment
    iphone
    go up