Magento 2 Email Configuration: Complete Setup and Optimization Guide

Magento Email Settings: Configure SMTP for Reliable Delivery
Denys Romanov Denys Romanov 28 january 2026, 13:54 944
For beginners

Running a Magento 2 store, you want to stay connected with your customers through every stage of their journey. Whether it involves simple order confirmations or critical password reset emails, the reliability of your email system directly impacts customer trust and your store's reputation.

If you ever worried about your emails landing in spam folders, wondered why customers claim they never received their order confirmations, or felt frustrated trying to configure SMTP settings properly, you're not alone. Email configuration in Magento 2 can seem cumbersome, but it doesn't have to be.

This guide covers everything you need to know about Magento 2 email configuration.

In the end, you'll learn how to implement a fully functioning email system that keeps your customers informed and your business running smoothly.

What is Magento 2? 

Magento 2 is an open-source eCommerce solution written in PHP programming language and serving over 200k websites. It replaced the original Magento 1, which stopped receiving support in June 2020. Being open-source means users can freely obtain and modify the source code according to their specific requirements. 

Magento 2 is both flexible and user-friendly, providing a wide range of powerful tools at reasonable price points, whether through the free, open-source Commerce edition or the premium Enterprise Edition and Enterprise Cloud Edition offerings. 

The platform is trusted by businesses worldwide to create feature-rich online stores, from small startups to enterprise-level retailers. 

Magento does quite well in several key areas:

  • Flexible catalog management system that handles thousands of products with ease;
  • Advanced customer segmentation for personalized shopping experiences;
  • Multiple payment and shipping integrations to serve global markets;
  • Robust order management system that streamlines fulfillment;
  • Powerful marketing tools facilitating promotions, upsells, and cross-sells.

However, all these features would mean nothing if your customers don't receive timely updates about their orders, shipments, and account activities. Email communication forms the backbone of customer experience in any ecommerce operation. This brings us to the next topic: why email settings matter for your Magento 2 store.

Why Email Settings Matter for Your Magento 2 Store

Emails convey important information between you and your customers. When they successfully place an order, they expect an immediate order confirmation email; later, they also receive shipping updates, along with other notifications. When configured properly, email builds trust. When misconfigured, it damages your reputation before you know it.

Having email delivery set up properly in your Magento 2 store, you can rest assured that your emails will be delivered reliably to your customers, improving the overall customer experience and trust.

Customer trust and satisfaction

Imagine placing an order and receiving no confirmation. That sinking feeling of "Did my payment go through?" or "Will I actually get my order?" creates anxiety. Professional, timely notifications reassure customers that their transaction was successful and their order is being processed.

Operational efficiency

Automated transactional emails handle routine communications without manual intervention. This allows your team to focus on complex customer service issues while ensuring every customer receives consistent, accurate information.

Brand reputation and deliverability

Your email sending reputation determines whether future messages reach the inbox or get flagged as spam. Poor configuration can lead to deliverability problems that persist for months, affecting marketing campaigns and transactional messages alike.

Types of Emails Magento 2 Sends

Magento 2 supports sending several types of automated emails to customers. These emails are commonly referred to as transactional emails. They include:

  • Account creation
  • New order placement 
  • Order confirmation
  • Email verification
  • Order update
  • Invoices and receipts
  • New shipment or shipment update
  • Password reset
  • Account update
  • …and many more

As a Magento 2 store owner, it’s important that you follow transactional email best practices to ensure the best shopping experience for your customers.

How to access email configuration settings in Magento 2 admin panel

For a start, you need to know where everything lives in the Magento 2 admin panel. The interface organizes email settings across several locations, which can be confusing.

General Store Email Addresses

Log in to your Magento 2 admin panel and navigate to Stores -> Settings -> Configuration -> General -> Store Email Addresses

How to access email configuration settings in Magento 2 admin panel  | UniOne Blog

This section lets you define the sender identities for different types of communications:

  • General Contact handles product inquiries and general questions;
  • Sales Representative sends order-related communications;
  • Customer Support manages service and account-related email;
  • Custom Email 1 and 2 provide additional sender identities for specific purposes

Each identity in Magento 2 requires a sender name and an email address. Use recognizable names, such as "Sarah from [Your Store Name]" or "Customer Care Team". Customers are more likely to open emails from identifiable senders.

Sales Email Configuration

Under Stores -> Settings -> Configuration -> Sales -> Sales Emails, you'll find templates and settings for order confirmations, invoices, shipment notifications, and credit memos. 

Sales Email Configuration in Magento 2 | UniOne Blog

Each section lets you:

  • Enable or disable specific email types;
  • Select which sender identity to use;
  • Choose email templates;
  • Designate copy recipients for internal tracking.

Marketing Email Templates

Go to Marketing -> Communications -> Email Templates to view, create, and modify the actual content and design of your emails using the template editor. This is where you'll customize the look and feel to match your brand.

Marketing Email Templates in Magento 2 | UniOne Blog

 

Marketing Email Template in Magento 2 | UniOne Blog

The image above shows the template editor, which lets you customize the template to match your brand using custom HTML and CSS.

Understanding this structure prevents the common frustration of changing settings in one place and not seeing results because the relevant configuration exists elsewhere.

How Magento 2 Sends Emails: the Two Ways

By default, Magento 2 uses PHP's built-in mail() function to send emails. While simple to set up (and usually done by the web server’s admin for you), this approach comes with significant limitations that affect deliverability and reliability.

How PHP mail() works and why SMTP is better for your Magento 2 store

The mail() function instructs your web server to send emails using the system’s default mail server. It's like handing a letter to your server and hoping it finds its way to the destination. You get minimal authentication, no sending reputation management, and limited error handling.

Email providers like Gmail, Outlook, and Yahoo have become increasingly sophisticated at filtering spam. When they receive emails sent via basic PHP mail(), they are likely to see:

  • No established sender reputation
  • Missing or improper authentication records
  • Potential signs of automated spam

The result? Your legitimate order confirmations might never reach customers, landing instead in spam folders or being rejected entirely. Even worse, you will not even know it's happening because error reporting is limited.

This is why we recommend configuring Simple Mail Transfer Protocol (SMTP) for your Magento 2 store. SMTP provides a robust, authenticated method for email transmission. For your Magento 2 store, this means better deliverability and improved security. 

Magento 2.4.6+ natively supports SMTP configuration, which is ideal for store owners who want a simplified setup without installing additional modules. The native SMTP configuration lets you specify the SMTP host, port, authentication method, encryption (TLS/SSL), and user credentials.

This native support is great, but using a custom SMTP extension like Magepal offers more advanced features and functionality. We will cover SMTP extension installation in the sections below.

SMTP Providers Compatible with Magento 2

You can connect your Magento store to almost any SMTP server available, be it your own server or a dedicated commercial service. We recommend the latter option, because maintaining your own email server and taking care of all problems, from data backups to deliverability issues, would take a lot of valuable resources. Choosing the right SMTP provider depends on your sending volume, budget, technical requirements, and deliverability needs. Here is a brief overview of the most popular options:

Gmail SMTP

Suitable for very small stores or development environments, Gmail SMTP is free but limited to 500 emails per day. It's not recommended for production environments with significant traffic.

SendGrid

Known for great deliverability and comprehensive analytics, SendGrid offers a free tier (100 emails per day) and scales well for growing businesses. Their API integration is robust, and support is top-notch.

Amazon SES (Simple Email Service)

If you're already using AWS infrastructure, SES provides incredibly cost-effective sending (as low as $0.10 per thousand emails). It requires more technical setup but offers excellent scalability.

Mailgun

Developer-friendly with detailed logs and analytics, Mailgun excels at both transactional and marketing emails. Their validation services help maintain list quality.

Mandrill (by Mailchimp)

Integrated with Mailchimp's ecosystem, Mandrill fits best if you're already using Mailchimp for marketing emails and want unified reporting.

SparkPost

Offers competitive pricing and strong deliverability, with particular strength in providing granular analytics of email performance.

UniOne

UniOne is a highly reliable SMTP provider with strong deliverability rates and fast sending speeds. UniOne offers a 4-month free trial that includes 6,000 emails per month, making it an excellent choice for new stores or those migrating from other platforms.

For comprehensive comparisons and detailed feature breakdowns, check out this roundup of the best SMTP service providers.

Installing and configuring an SMTP extension

While Magento 2.4.6 and later versions natively support SMTP configuration, you will likely benefit from a dedicated SMTP extension that provides improved experience, better logging, and easier configuration.

Several of these  extensions are available, both free and premium:

In this guide, we’ll install Magepal’s custom SMTP extension and configure it with the SMTP credentials from your UniOne dashboard. Magepal is relatively easy to install and configure, making it a popular option.

Follow the steps below to install the Magepal extension and connect it with your SMTP credentials.

Step 1: Access your server

Connect to your Magento 2 server via SSH and navigate to the root directory of your Magento project.

Step 2: Install the extension via Composer

The free Magepal extension is available under the package name magepal/magento2-gmailsmtpapp. To install it via Composer, run the following command:

composer require magepal/magento2-gmailsmtpapp

You should get an output like this in your terminal if the extension download is successful:

Installing and configuring an SMTP extension in Magento 2 | UniOne Blog

You may need to enter your Magento Marketplace access keys (public key as username, private key as password) when prompted for authentication.

Step 3: Enable the module and run setup commands

After the package installation is complete, run the following commands:

php bin/magento module:enable MagePal_Core MagePal_GmailSmtpApp
php bin/magento setup:upgrade

Step 4: Compile and deploy static content 

Run the commands below to compile and deploy your Magento 2 static site:

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Step 5: Access the Magepal extension in your Magento 2 admin panel

Now that the installation is complete, log in to your Magento 2 admin panel. Navigate to Stores -> Settings -> Configuration -> Magepal -> SMTP Configuration.

Access the Magepal extension in your Magento 2 admin panel | UniOne Blog

Click the Stores > Configuration > Advanced > System > SMTP Configuration and Settings link and set the “Enable” field from “No” to “Yes.”

The SMTP configuration fields appear as shown below:

The SMTP configuration fields in Magepal | UniOne Blog

If you’re using UniOne as your SMTP server provider, follow these steps to obtain your credentials for SMTP configuration:

  1. Sign up for a UniOne account.
  2. Add and verify your sender domain, and configure DNS records. To learn more, refer to this video. Alternatively, you can learn more in our guide on Setting up the domain’s DNS records. Note that UniOne comes with a free, pre-verified sandbox domain, which is a temporary domain for testing your email sending functionality before setting up your production domain.
  3. Navigate to Settings -> SMTP Configuration to get your SMTP credentials for sending emails.

Fill in the Magepal form, entering the following details:

  • SMTP Host
  • SMTP Port
  • Username
  • Password

Next, use the “Test Email Server Configuration Settings” section to verify that your email configuration is correct.

Test Email Server Configuration Settings in Magepal | UniOne Blog

Enter the To and From email addresses. The From address should be an email address on your domain already verified in UniOne, or on the free sandbox domain provided by UniOne when you sign up. Using the sandbox domain is recommended for testing. It also helps preserve domain reputation in case you make any errors.

Click Send Test Email.

You should get an email confirming that your SMTP settings with Magepal’s extension are correct. Check your mailbox for the incoming test email:

Send Test Email in Magepal | UniOne Blog

Customizing Email Templates in Magento 2

Magento 2 allows you to customize templates according to brand requirements. To access the template editor, navigate to Marketing -> Communications -> Email Templates.

Customizing Email Templates in Magento 2 | UniOne Blog

To create a template:

  1. Click Add New Template.
  2. Select a Default Template from the dropdown (e.g., "New Account").
  3. Customize the Template Name, Template Subject, and Template Content.
  4. Click Preview Template to see how your changes and customizations appear in the browser.
  5. Add Template Styles (CSS code) for visual formatting. 
  6. Save your new template.

Edit Email Templates in Magento 2 | UniOne Blog

You can always edit the templates by clicking on any of them. The template editor opens, and you can alter the templates as needed.

For inspiration and proven tips, explore these transactional email examples that demonstrate effective design patterns.

Testing Your Email Configuration

Now that you have configured email delivery via SMTP, it’s important to make sure that your configuration works.

Using Built-in Test Functions

Most SMTP extensions include test email features. Look for sections labeled "Send Test Email" or "Test Configuration". In Magepal (used earlier as an example), the section is labeled  “Test Email Server Configuration Settings”.

  1. Enter a recipient email address.
  2. Optionally specify a sender address.
  3. Click Send Test Email.
  4. Check both the inbox and the spam folder.

Successful delivery confirms that the basic configuration works. If the test fails, verify your credentials or review the Magento error logs.

Testing Template Rendering

Beyond basic delivery, verify templates display as intended:

  1. Place a test order on your store.
  2. Check the order confirmation email in multiple email clients.
  3. Verify all variables are placed correctly (no broken code like {{varname visible in the email).
  4. Make sure that all images load and links work.
  5. Test on both desktop and mobile devices.

Using Email Testing Tools

Use UniOne’s SMTP Debug Tool to verify your email sending setup and troubleshoot deliverability issues. Send a test email using the SMTP Test, SMTP Proxy, or SMTP Blackhole option, then review the detailed SMTP session logs and error output provided by UniOne to identify configuration problems and delivery errors.

What if emails are not being sent?

When emails aren't going out, try out the troubleshooting options below.

  • Option 1: Verify basic SMTP configuration by doing the following:
    • Confirm SMTP is enabled in the extension settings.
    • Double-check host, port, username, and password.
    • Test with the extension's built-in test function.
  • Option 2: Check Magento cron jobs. Magento queues emails for batch sending via cron. Verify cron is running:

php bin/magento cron:install

Check cron status and recent executions in the database or admin panel.

  • Option 3: Ensure sender addresses in Store Email Addresses use domains you own. Sending from random@gmail.com while your domain is yourdomain.com leads to authentication problems.
  • Option 4: Verify that the Sales Representative email address is properly configured under Stores -> Configuration -> General -> Store Email Addresses.
  • Option 5: Navigate back to Stores -> Configuration -> Advanced -> System and verify that 'Disable Email Communications' is turned off. While in the same configuration menu, proceed to Sales -> Sales Emails -> General and disable 'Asynchronous sending'. Also, under the 'Order' tab, ensure that 'Enabled' is set to 'Yes'.
  • Option 6: Verify that no third-party modules are interfering with email delivery. For instance, a custom payment gateway extension might be preventing emails from being sent.

Why Do Magento Emails Sometimes Go to Spam?

Magento emails may occasionally land in spam for specific, fixable reasons. Understanding these causes helps you prevent deliverability problems before they occur.

Missing or failed authentication

Email providers prioritize authenticated messages. If your SPF, DKIM, or DMARC records are missing, misconfigured, or failing validation, spam filters treat your emails with suspicion. A single failed authentication check can send legitimate order confirmations straight to spam.

Poor sender reputation

Your sending IP address and domain accumulate reputation scores based on past sending behavior. High bounce rates, spam complaints, or sudden volume spikes damage this reputation. Shared hosting amplifies this problem. If another site on your server sends spam, your emails suffer the consequences.

The best way to deal with this major problem would be using a dedicated IP address for your emails. This way, your reputation is completely isolated and never influenced by third parties. Also, use separate IPs and third-level domains for your transactional and marketing messages.

Spam-Like Content patterns

Even with perfect authentication, certain content triggers spam filters:

  • ALL CAPS subject lines or excessive exclamation marks
  • Trigger phrases like "Act now!", "Click here!", or "Congratulations!"
  • High image-to-text ratios with minimal readable content
  • Misleading subject lines that don't match email content
  • Broken HTML or suspicious formatting (like hidden elements)

Technical configuration issues

Using default PHP mail() instead of authenticated SMTP creates immediate deliverability problems. Missing reverse DNS records on your sending IP suggest an improperly configured mail server. Mismatched sender domains (like sending from gmail.com while your store is yourstore.com) confuse authentication systems. 

Blacklisted IPs or domains

If your sending IP address appears on spam blacklists like Spamhaus or SORBS, major email providers will automatically filter or reject your messages. This happens when servers are compromised, send actual spam, or generate excessive bounce rates.

No engagement history

Emails to recipients who never interact with your messages lower your sender score over time. If customers consistently ignore or delete emails without opening them, providers regard this as unwanted mail.

For detailed strategies to maintain inbox placement and recover from spam folder issues, review this comprehensive guide on how to prevent emails from going to spam.

Best Practices for Email Deliverability

Email deliverability requires consistent attention across technical configuration, content strategy, and list management. Following these proven practices keeps your Magento emails reaching customers' inboxes reliably.

Use dedicated SMTP services

Abandon the default PHP mail() in favor of professional SMTP providers like UniOne or similar services. These providers maintain excellent IP reputation, handle authentication automatically, provide detailed delivery analytics, and offer expertise in deliverability management. Dedicated SMTP isolates your sending reputation from shared hosting neighbors and provides infrastructure designed specifically for transactional email success.

Implement email authentication

Configure SPF, DKIM, and DMARC for your sending domain without exception. These three techniques form the foundation of modern email deliverability. Omitting one significantly increases the risk of landing in spam folders. 

Verify authentication setup using tools like Google's CheckMX or UniOne’s SMTP debug tool. Set DMARC policy to at least p=quarantine once you've confirmed legitimate emails authenticate properly, and monitor DMARC reports weekly to catch authentication failures in time.

Maintain list hygiene

Build your own suppression list of addresses that should never receive emails from your store. Include hard bounces (permanently invalid addresses), users who marked your email as spam, unsubscribed recipients (for marketing emails), and role-based addresses generating automated responses (like postmaster@ or noreply@ addresses).

Your SMTP provider will automatically handle bounce detection for you, and you will be able to access delivery results via webhooks or CSV downloads. Record soft bounces (temporary failures like full mailboxes) which you may retry a few times before suppressing. Hard bounced addresses should be suppressed immediately, as continuing to send to these damages reputation. Suppress addresses that generate spam complaints. Consider re-engagement campaigns for subscribers inactive beyond 6-12 months, then remove non-responders.

Review bounce reports regularly to identify patterns which may point to particular issues. Multiple bounces from the same domain might indicate their spam filter is blocking you, requiring authentication review or contacting that specific provider.

Never purchase email lists; they contain spam traps that trigger instant blacklisting. Validate email addresses at checkout using real-time verification to prevent typos and fake addresses from entering your list.

Watch out for blacklisting

Your sending IP address or domain can appear on public spam blacklists maintained by organizations like Spamhaus, SORBS, Barracuda, and SpamCop. When blacklisted, email providers automatically reject or filter your messages regardless of content quality. 

Use comprehensive blacklist checking tools like MXToolbox Blacklist Check or MultiRBL.org to scan dozens of lists simultaneously. Enter your sending IP address (available from your SMTP provider) and domain to see the current status across major blacklists.

Each blacklist operates independently with unique delisting procedures. Visit the blacklist's website to understand why you were listed. Common reasons include compromised servers sending spam, high complaint rates, or poor list hygiene generating excessive bounces.

Fix the root cause before requesting removal; otherwise, you'll be relisted quickly. Most blacklists provide delisting request forms requiring your IP address, an explanation of corrective actions taken, and contact information. 

Processing times range from immediate to several days. Some blacklists automatically delist after a period without further violations, while others require manual intervention.

To prevent future blacklisting, use a reputable SMTP provider with proactive monitoring and abuse prevention systems built in. Implement double opt-in for any subscription lists to ensure recipients want your emails. Maintain bounce rates below 2% by removing invalid addresses promptly.

Monitor complaint rates and keep them under 0.1% by sending relevant content to engaged subscribers only. Secure your server and email accounts to prevent compromise by spammers who might use your infrastructure for malicious sending.

How to Track Email Performance

Tracking email performance provides insights into customer engagement and helps identify deliverability issues before they become critical. Understanding how recipients interact with your emails guides improvements to content, timing, and strategy.

Implementing tracking in Magento 2

Magento doesn't include native open and click tracking for transactional emails. Fortunately, most SMTP providers, such as UniOne, offer built-in tracking dashboards that show opens, clicks, bounces, and spam complaints. 

UniOne tracking and analytics page for email delivery reports | UniOne Blog

UniOne tracking and analytics page for email delivery reports

UniOne tracking and analytics page for email event history | UniOne Blog

UniOne tracking and analytics page for email event history

The email event history screenshot above shows the previously sent MagePal email, including its delivery status and other related data. Tracking and analytics are handled automatically once you configure the Magepal custom SMTP extension using your UniOne credentials.

Bottom Line

Email configuration in Magento 2 might seem a bit complex at first, but it's absolutely manageable when you break it down into clear steps. The key is getting the fundamentals right: implement SPF, DKIM, and DMARC authentication from day one, use SMTP instead of the default PHP mail() for better deliverability, and choose quality dedicated SMTP services. 

Beyond the technical setup, make email work harder for your business by customizing templates to reflect your brand, testing regularly across different email clients, and monitoring your metrics closely. 

Email remains one of the most reliable and cost-effective ways to communicate with customers. When configured properly, your Magento 2 email system becomes a powerful asset that strengthens customer relationships and drives revenue, rather than a source of frustration and missed opportunities.

UniOne offers specialized solutions that complement your Magento 2 email configuration:

  • Transactional Email Templates – Pre-designed, professionally crafted templates optimized for common ecommerce scenarios. Save development time while ensuring emails look polished across all email clients.
  • SMTP Relay Service – Reliable SMTP infrastructure with excellent deliverability rates, detailed analytics, and seamless integration with Magento 2. Offload email sending to a platform that focuses exclusively on email delivery.
  • Transactional Email Services – Comprehensive transactional email solutions including delivery optimization, advanced analytics, and deliverability consulting to ensure your critical customer communications reach their destination.

FAQ

What is the default SMTP server for Magento?

Magento 2 doesn't use a default SMTP server out of the box. Instead, it uses PHP's built-in mail() function, which relies on your web server's local mail transfer agent. This means emails are sent directly from your hosting server without SMTP authentication. The default approach works without user configuration (instead, it relies on the mail server provided by the hoster) but suffers from poor deliverability, next to no error reporting, and high spam folder risk. 

For production stores, you should configure a proper SMTP server through services like UniOne or similar providers rather than relying on the default mail function. This switch requires installing an SMTP extension (for versions before 2.4.6) or configuring the built-in SMTP settings (for 2.4.6+), then entering your chosen provider's credentials, including host, port, username, and password.

Can I use Gmail SMTP for my production Magento 2 store?

Technically, yes, but it's not recommended for stores with significant traffic. Gmail imposes a 500 emails per day limit for regular accounts and 2,000 per day for Google Workspace accounts. Active ecommerce stores quickly exceed these limits. Also, Gmail SMTP may throttle sending or temporarily suspend accounts that trigger suspicious behavior detection. For production environments, use dedicated transactional email services designed to handle ecommerce volumes.

How often should I update my DKIM keys?

Best practice suggests rotating DKIM keys every 6-12 months as a security measure. However, key rotation requires careful coordination to avoid breaking email authentication. When rotating, set up the new key with a different selector before removing the old one, allowing both to coexist during the transition period. Many SMTP providers handle key rotation automatically, so check whether your provider manages this for you before implementing manual rotation.

Related Articles
Blog
For experts
How to Configure an SMTP Server Connection?
Tutorial on SMTP configuration procedures.
Alexey Kachalov
11 january 2022, 13:053 min
Blog
For beginners
iCloud SMTP Settings: A Complete Setup and Configuration Guide
The iCloud SMTP server configuration is at your fingertips with our step-by-step guide.
Andrew Dyuzhov
06 may 2026, 10:597 min
Blog
For beginners
GoDaddy Email SMTP Settings: A Complete Guide to Setup and Configuration
Learn how to set up emails on GoDaddy hosting.
Alexey Kachalov
22 april 2026, 16:5310 min