Sell more with better email & SMS

Get ecommerce-focused email & SMS marketing that makes it easier to grow your brand, get sales & build better relationships.

Drive sales on autopilot with ecommerce-focused features

See Features

Sending emails in WordPress: a step-by-step guide 2024

Reading Time: 9 minutes

A common myth about how WordPress sends emails is that all emails end up in the recipient’s spam folder. While it’s true that this can be the case, WordPress emails are often flagged as spam due to hosting issues or poor PHP configuration.

The native WordPress email feature has limited capabilities, and configuring WordPress email settings manually can be technical. Also, since emails are sent via the web host server by default, it can cause unreliability.

This does not mean that there’s no solution to these problems. 

This post discusses how to configure WordPress to send emails with better deliverability rates.  

Let’s get started.

Looking for a plugin to send emails successfully via WordPress?

How to send email from WordPress

How does WordPress send email? By default, it uses PHP-based wp_mail function to send email. This feature uses your hosting web server to send emails. 

Here’s how this feature works:

Step 1: There’s the wp code snippet to specify the subject, recipient, message, etc, and email.

Step 2: wp_mail(), through the PHP mail function instructs the server to send emails. 

Step 3: Your WordPress hosting service provider initiates the process by requesting PHP mail to send the email. The hosting servers use SendMail or Postfix to route emails to your recipients. The receiving host can then reject or accept the email.

process of PHP mail function instructing the server to send emails

Since over 20 other WordPress functions use wp_mail, it’s not surprising that this function can be unreliable. 

The feature also makes it hard to build HTML templates, add images or attachments, and more importantly email headers, without making some adjustments.

All these shortcomings make your emails more likely to wind up in your recipient’s spam folder.

Further, WordPress’s inbuilt tool is limited in the types of emails you can typically send. There are a few triggered emails that you can send, which include:

  • Password resets
  • Transactional emails
  • Form notifications

WordPress email users can easily check if the default w_p email is active on the WordPress site using the free Check and Log Email plugin. You can find this plugin on your WordPress dashboard. 

The process is simple, choose an email address that can receive your test email. Enter the email address in the “Send test email to” box and and click on the Send test email button. Then, go ahead and check your inbox to see if you received the email.

You’ll make one of three observations:

  • WordPress successfully delivered the email to your inbox, which would mean that the feature works perfectly.
  • The email ended up in your Spam folder, which means there may be authentication or verification issues that are causing email clients to flag your emails.
  • You did not receive the email, which means WordPress did not send it in the first place. In this case, your host may have disabled PHP mail.

In the case of the second and third results, there are other options to send emails from WordPress to fix these issues. These include using a WordPress plugin or setting up an SMTP server manually using wp-config.php.

We’ll discuss these in the next sections.

How to configure WordPress to send email

As mentioned, the default wp email function comes with its setbacks that may lead to your emails getting stuck in the spam folder, or not being sent at all. 

Setting up an SMTP plugin on your WordPress resolves most of these configuration issues. The plugin configures your wp_mail() to use SMTP instead of PHP and routes the email through an email-sending service.

The combination improves your site’s reliability and email deliverability.

Here’s a step-by-step guide on how to do it.

Step 1. Select a dedicated sending service/SMTP plugin from WordPress

Here, you’ll log in to your WordPress as an admin. On the left menu, click on Plugins then Add New. Click on the search box in the right corner, type WP Mail SMTP by WPForms, and search. 

Then, click Install Now, then click on Activate once the installation is complete.

Step 2: Configure settings for “Mail”

Go to the settings page of the plugin and configure the following Mail setup.

  • From email: Enter the email address that you want to send all your emails from. It’s important to know that this email address must be created on your domain as third-party email addresses will not work. 

Be sure to check the box labeled Force From Email to ensure that your From Email setting will be used for all your emails. 

"Force From Email" checkbox
  • From name: This is set to the name of your website by default, but you can change it to anything you want. Here, you can also enable the Force from the name setting to apply this name sitewide. 
"From Name" setting
  • Return path: Check the Return Path option to ensure your return path matches your From Email. This way you’ll get notified if any email bounces because of problems on your recipient’s end.
"Return Path" checkbox
  • Mailer: Here, you’ll select Other SMTP option.
"Other SMTP" option

Step 3: Configure “Other SMTP” settings

Select the Other SMTP icon at the bottom as your mailer. Another section will appear with settings for you to configure. These include:

  • SMTP Host: Enter the outgoing server in your email provider’s SMTP settings.
  • Encryption: Encryption used for the SMTP connection, i.e. TLS, SSL, or none.
  • SMTP Port: The port that your provider uses for SMTP connection. It’s [re-filled depending on the encryption selected.
  • Auto TLS: This option appears for SSL encryption only. The field needs to be selected i.e. it needs to be on.
  • Authentication: You’ll need to enable this button.
  • SMTP Username: Enter the email address you entered in the From Email field.
  • SMTP Password: Here, you’ll need to generate a password for your account.
Configuring “Other SMTP” settings

Finally, select Save Settings at the bottom of the page to confirm your configuration.

Step 4: Send a test email

Here are the steps for sending a test email:

  • Go to the WP Mail SMTP settings page and click on the Email Test option
  • Enter a recipient’s email address that you can access
  • Click on the Send Mail button and wait for a few seconds.
  • Go to your email address and see if you’ve received the email. If it was sent successfully, it should be in your inbox.
  • If the email ended up in the spam folder, you’ll need to add an SPF record to DNS settings.

Step 5: Set up an SPF record (optional)

An SPF ensures spammers do not use your domain as their senders’ email address. It specifies the servers authorized to send emails from your website’s domain. Therefore if the server is not approved, the email will be marked as unauthorized and will be rejected or sent to spam.

Here are some SMTP configuration best practices for email deliverability:

  • Use DNS records like SPF, DMARC, and DKIM to protect your domain from email spoofers
  • Try sender reputation warming to improve deliverability
  • Ensure your IP address is not on any block list

Plugins for email in WordPress

Plugins make it easier to send emails on WordPress and ensure they don’t end up in your users’ spam folders. They improve email deliverability, and allow you to manage your audience more effectively. 

Email plugins offer much more functionality than you can find on WordPress’s default email function. This is especially so if you’re looking for an automated email marketing solution or a mass email service to reach a wider audience.

With the right plugin, you can send marketing emails without leaving your WordPress dashboard. Depending on the plugin you choose, you’ll be able to conduct functions such as:

  • Build opt-in forms to grow your subscriber list
  • Send automated emails to your target audience
  • Segment your email contact lists
  • Create ecommerce-focused emails, etc.

How to set up Omnisend for WordPress

You’ll need to set up the Omnisend backend integration to be able to use it on your WordPress store. This requires some developer knowledge and can be complex. 

However, if you have the WooCommerce plugin installed, you’ll only need to install Omnisend as a plugin with no need for backend configurations. 

If you do not have a WooCommerce plugin, this section discusses the front-end configuration for Omnisend for WordPress. 

Step 1: On the Omnisend Dashboard, go to Connect Your Store, then click on Other. Enter your store URL and click on the Connect to Store button.

Step 2: You’ll find snippets on the next page that you should paste to the HTML source code on your site. Be sure to insert the snippet on every page of your online store. 

Alternatively, you can use an additional WordPress plugin to add the frontend snippet on every page. Here’s how to use Code Snippets.

  • Go to the WordPress admin dashboard, then Plugins, search for “Code Snippets” and then click Install. Activate the plugins once the installation is done.
“Code Snippets” plugin
  • Check the Admin dashboard sidebar and select Snippets
Snippets in admin dashboard sidebar
  • Search for “Example Javascript snippet”, click the button to turn it on, hen click edit.
turning on “Example Javascript snippet”
  • Paste this snippet there and replace the text <YOUR BRAND ID> with your Omnisend Brand ID. 

add_action( ‘wp_footer’, function () { ?>

<script type=” text/javascript”>

//OMNISEND-SNIPPET-SOURCE-CODE-V1

window.omnisend = window.omnisend || [];

omnisend.push([“accountID”, “<YOUR_BRAND_ID>”]);

omnisend.push([“track”, “$pageViewed”]);

!function(){ var e=document.createElement(“script”);e.type= “text/javascript”,e.async=!0,e.src= “https://omnisnippet1.com/inshop/launcher-v2.js”; var t=document.getElementsByTagName(“script”)[0];t.parentNode.insertBefore(e,t)}();

</script>

<?php } );

  • At the bottom of the page, select Run Snippet everywhere to paste the snippet on all your pages. Rename the snippet for later use, then click on “Save Changes.” 
Run Snippet everywhere
  • Go back to the Omnisend store and click Verify.

The Omnisend plugin is especially crucial for ecommerce platforms looking to elevate their email marketing campaigns. You can build an email list, use its robust marketing automation feature, segment your list, send email and SMS campaigns, and more.

It’s important to send a test email so you can preview what your emails will look like in your recipient’s inbox.

Common Email Issues in WordPress

Some common problems that come up when using WordPress for emails include emails going to spam or not getting delivered. 

These problems have two major causes. One is that your WordPress server may not have the proper configuration to send emails. The other is the unreliable nature of the PHP mail that your default WordPress email function is based on.

Here are some tips to resolve the common email issues in WordPress.

  • Installing a WordPress SMTP plugin using the steps discussed above. 
  • Choosing an email-sending service to deliver your emails e.g. Omnisend
  • Configure your SMTP plugin to use your chosen email sending service

It’s crucial to fix these WordPress issues so you can stay in contact with your audience and promote customer engagement through your newsletters. Also, when your emails are no longer being flagged, you can preserve your site’s reputation.

Wrap up

If you’re sending WordPress emails to your audience, it’s crucial to take the necessary steps to make the most out of the platform. 

As discussed WordPress provides free SMTP plugins you can download and configure for better deliverability. You can also set up other third-party plugins for an even wider range of functionalities, especially for email marketing. 

For instance, the Omnisend email marketing plugin allows you to send both email and SMS campaigns in a single channel. 

You’ll also get a wide range of ecommerce functionality, including automation, segmentation, and omnichannel marketing. Configuration is easy, especially if you have a WooCommerce plugin on your WordPress website.

For more information, use our email pricing calculator below to quickly compare price rates and features with other top platforms. Input your desired number of contacts, choose up to two other email marketing providers from the list, and see how Omnisend stacks up against them. 

Quick email provider pricing comparison

Quickly and easily compare the top email marketing providers so you can find the best platform for your ecommerce store needs.

Total number of contacts:
Oops! Please enter something valid.
    Compare
    prices for:

    You can compare Omnisend and 2 more providers at once.

    • Omnisend
    • Klaviyo
    • Mailchimp
    • Drip
    • Moosend
    • Active Campaign
    • Get Response GetResponse
    • Mailerlite

    You can compare Omnisend and 2 more providers at once.

    Free
    Tier 1
    Tier 2
    Tier 3
    Still not sure?

    Try out the full version of this calculator

    Get started with Omnisend and send SMS, MMS, and push notification messages all in a single channel
    Bernard Meyer
    Article by
    Bernard Meyer

    Bernard is the Sr. Director of Communications & Creative at Omnisend, with a passion for good research, helping ecommerce businesses with their marketing automation needs, and beating absolutely everyone in Mario Kart 64.


    related features
    These are the Omnisend features that can help you get the results mentioned in the article.

    See how Omnisend can help your business

    Take our short quiz to get a personalized recommendation on the best plan & features for your business.

    Take the quiz
    Takes less than 2 minutes

    related features
    These are the Omnisend features that can help you get the results mentioned in the article.