Less stress, more connection

Turn first-time visitors into lifelong subscribers. Reach &
engage them. All automatically, without the stress.

Learn more

Drive sales on autopilot with ecommerce-focused features

See Features

Send emails from WordPress — a step-by-step guide for 2025

Reading Time: 15 minutes

In 2025, many users still encounter problems with the WordPress send email functionality. This includes emails going to spam folders or not sending at all. Plus, the lack of native customization options makes it difficult to personalize messages to customers, leaving default messages feeling bland. 

Thankfully, there are easy ways to resolve these issues. You can leverage powerful plugins to customize your WordPress emails and improve deliverability. If you have some technical knowledge, you can even make changes to your website’s code to send emails successfully. 

In this guide, we’ll show you how to send emails in WordPress using native features and plugins. We’ll also cover troubleshooting tips for common email issues.

Let’s dive right in!

Looking to send successful emails via WordPress? Omnisend has you covered

Quick sign up | No credit card required

How does WordPress send emails?

WordPress sends emails using the built-in wp_mail function, which relies on a hypertext preprocessor (PHP) to process and send messages. 

This function is responsible for sending various types of emails, including password resets, notifications, and updates from your WordPress site. While the wp_mail functionality works for basic needs, it often lacks the reliability and customization that many users require.

Plus, these emails are sent through your web host’s server, which can sometimes lead to deliverability issues like messages being flagged as spam or not sending at all. 

There are several ways to improve how WordPress handles your emails. You can:

  • Use dedicated email plugins
  • Set up a simple mail transfer protocol (SMTP) for more stable delivery
  • Implement programmatic changes for advanced customization 

These methods enable you to overcome the limitations of the default WordPress send email functionality and ensure that your messages are sent effectively.

How to send emails from WordPress using the wp_mail() function

The wp_mail() function is the WordPress built-in method for sending emails. It uses PHP’s mail() function, which sends messages from your hosting server.

Here’s a breakdown of how the process works:

1. Preparing the email

The first step involves preparing the email using the wp_mail() function. This function lets you define the recipient, subject, message content, and optional parameters like headers or attachments. 

Here’s a basic example:

wp_mail( $to, $subject, $message, $headers, $attachments );

During this stage, the function formats the email for sending, but doesn’t handle any authentication or advanced formatting.

2. Calling the PHP mail function

Once the email is prepared, wp_mail() triggers the PHP mail() function. This is a lower-level command that interacts with your web server. 

The PHP mail() function forwards the email details to the server’s mail transfer agents (MTAs), like SendMail or Postfix, and instructs them to send the message.

Hovewer, this process lacks error handling, meaning issues like server misconfigurations or missing parameters can go unnoticed, which leads to failed deliveries.

3. Sending the email

The final step relies on your hosting provider to deliver the email. Hosting servers route the email to its destination using the information provided by wp_mail(). 

Unfortunately, many web hosts don’t have proper authentication protocols in place, like SPF (Sender Policy Framework), DKIM (DomainKeys Identified Mail), or DMARC (Domain-based Message Authentication, Reporting and Conformance). As a result, receiving mail servers often mark these emails as spam or reject them entirely. 

This issue is more common in shared hosting environments, where multiple users share the same server and IP address. If one of the websites on the server sends spam, the shared IP address can get flagged or blocklisted, which will affect all users on the server.

The WP mail function has some other limitations. For example, it makes it difficult to create HTML templates, add images or attachments, and include email headers. 

Plus, you can send only a select number of triggered emails with this function, including password resets, transactional messages, and form notifications. 

If you’re wondering whether this feature is enabled on your WordPress website, there’s an easy way to check. First, install the Check & Log Email plugin on your site. Here’s an image showing where to find the plugin in the directory:

WordPress send email: check & log email plugin

Then, go to Check & Log Email > Test Email and enter an email address for the test, as you can see below:

check & log email testing

Click on Send test email. Now, one of three things will happen:

  1. You receive the email in your inbox, which means the feature works well
  2. The email ends up in your spam folder, which suggests an authentication or verification issue with the server
  3. You didn’t receive the email, as your host may have disabled PHP

If you encounter the second or third scenario, you have other options for sending emails from WordPress to fix these issues. These include using a WordPress plugin or manually setting up an SMTP server using wp-config.php.

We’ll discuss these methods in the next sections.

How to send emails using the WordPress SMTP plugin

As mentioned, the default wp_mail function has limitations 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 site resolves most of these configuration issues. The plugin configures wp_mail() to use SMTP instead of PHP and routes the email through an email-sending service. This process improves your site’s reliability and email deliverability.

Let’s look at configuring the WordPress send email functionality over SMTP. 

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

Go to Plugins > Add New Plugin and look for WP Mail SMTP by WPForms in your WordPress dashboard. Then, click on Install Now, followed by Activate. Here’s what the plugin will look like when you search for it:

WordPress send email: WP Mail SMTP

2. Configure settings for “Mail”

Now, go to WP Mail SMTP > Settings in your dashboard. In the From email field, highlighted below, enter the email address from which you want to send your emails.

from email field

This email address must be created on your domain, as third-party email addresses will not work.

Also, make sure to enable the toggle switch for Force From Email (as shown in the image above) to ensure that your From Email setting will be used for all your emails. 

Next, go to the From Name field. This is set to the name of your website by default, but you can change it to anything you want, as shown:

from name

Here, you can also enable the Force From Name setting to apply this name sitewide. 

By turning on the Return Path option, you can ensure that your return path matches your From Email. This way, you’ll be notified if any email bounces because of problems on your recipient’s end.

Finally, you’ll need to select a mailer. WP Mail SMTP supports multiple SMTP services, including Gmail, Outlook, SendGrid, and Mailgun.

You’ll need to select the Other SMTP option for this tutorial, as we’ll set it up manually. You can see it selected from the list below:

WordPress send email: other SMTP

However, feel free to select a pre-configured service of your choice if you prefer it over the manual setup of this tutorial.

You’ll want to choose a service that’s designed for the type of messages you want to send, mainly transactional and bulk emails.

Transactional emails are one-to-one communications triggered by user actions or events on your site. Examples include order confirmations, password resets, and account verification emails.

On the other hand, bulk emails are typically used for marketing campaigns, newsletters, promotional offers, or announcements. They’re designed to engage a larger audience and may require compliance with email marketing regulations like the CAN-SPAM Act.

Gmail SMTP is ideal for smaller-scale transactional needs. It has a straightforward setup and integrates with Google’s ecosystem. Meanwhile, SMTP services like SendGrid, Mailgun, and Postmark are designed to handle large volumes of bulk emails for marketing purposes.

3. Configure “Other SMTP” settings

When you select the Other SMTP option, a section will appear with settings for you to configure, as shown below:

other SMTP settings

These include:

  • SMTP Host: Enter the outgoing server in your email provider’s SMTP settings
  • Encryption: Select the encryption used for the SMTP connection, e.g., TLS, SSL, or none
  • SMTP Port: The port your provider uses for SMTP connection is pre-filled, depending on the encryption selected
  • Auto TLS: This option only appears for SSL encryption and must be switched on
  • Authentication: You’ll need to enable this button
  • SMTP Username: Enter your email address in the From Email field
  • SMTP Password: Here, you’ll need to generate a password for your account

When you’re ready, select Save Settings at the bottom of the page to confirm your configuration.

It’s important that you secure your SMTP credentials to protect your emails from unauthorized access. 

Make sure that your SMTP password is complex and not reused across multiple services. Strong passwords include a mix of uppercase, lowercase, numbers, and special characters.

Also, access to SMTP credentials should only be provided to trusted users or applications. Avoid sharing credentials publicly or via unsecured methods such as email or chat services.

It’s also a good idea to periodically change your SMTP credentials to minimize risk.

4. Send a test email

Now, it’s time to send a test email. Go to WP Mail SMTP > Tools in your WordPress dashboard and enter an email address as shown:

WordPress send email: WP mail SMTP tools

Then, click on the Send Email button and wait for a few seconds. Go to your inbox and see if you’ve received the email.

If the email is in the spam folder, you’ll need to add an SPF record to DNS settings.

If the test fails, return to the previous step to check that your SMTP credentials are correct. You’ll also need to check your SPF and DKIM records (see the next step). 

5. Set up an SPF record (optional)

An SPF record ensures that spammers don’t 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 rejected or sent to spam.

You’ll need to log into your hosting account and locate your DNS settings to set up this record. If you purchased your domain from a domain registrar, you’ll need to log into that account instead. 

The process will vary depending on the provider, so you may need to reach out to them for assistance. 

Here’s an example of an SPF record:

v=spf1 include:your-mail-provider.com ~all

While you’re here, you might also want to check that you have DKIM and DMARC records set up. 

DKIM adds a cryptographic signature to your emails to prove they originated from your domain and haven’t been altered in transit. Make sure that your DNS includes the DKIM TXT record provided by your SMTP service provider.

Meanwhile, a DMARC works alongside SPF and DKIM to protect your domain from unauthorized use. It specifies how to handle emails that fail SPF and DKIM checks.

Here’s an example of a DMARC Record:

v=DMARC1; p=reject; rua=mailto:[email protected];

Also, ensure that your Mail Exchange (MX) records point to the correct mail server. This way, incoming emails are routed to your domain’s email service provider.

Try sender reputation warming to improve deliverability. This means starting by sending emails to a small group of people and gradually increasing the number of recipients.

Finally, make sure that your IP address is not on a blocklist. Tools like MXToolBox or Sender Score can help you check the current status of your IP address on various blocklists.

How to send an email from WordPress without plugins

If you’re looking to send emails from WordPress without a plugin, you can manually configure SMTP settings directly in your site’s wp-config.php file and customize your theme’s functions using PHP code. 

This method is best suited for developers who are comfortable with modifying WordPress core files.

Here’s a step-by-step guide:

1. Prepare your SMTP service

First, you need an SMTP service like Mailtrap, MailerSend, SendGrid, or others. Ensure you’ve verified your domain with your chosen service and retrieved the necessary credentials.

2. Access the wp-config.php file

Connect to your website using an FTP client like FileZilla or access it through an SSH terminal. Locate the wp-config.php file in the root directory of your WordPress installation.

3. Edit wp-config.php

Open wp-config.php in a text editor and add the following SMTP configuration:

define( ‘SMTP_USERNAME’, ‘your-smtp-username’ );  

define( ‘SMTP_PASSWORD’, ‘your-smtp-password’ );  

define( ‘SMTP_SERVER’, ‘smtp.your-smtp-service.com’ );  

define( ‘SMTP_FROM’, ‘[email protected]’ );  

define( ‘SMTP_NAME’, ‘Your Name’ );  

define( ‘SMTP_PORT’, 587 );  

define( ‘SMTP_SECURE’, ‘tls’ );  

define( ‘SMTP_AUTH’, true );  

define( ‘SMTP_DEBUG’, 0 );  

Save your changes.

4. Update theme functions

Navigate to your WordPress dashboard and go to Appearance > Theme Editor. Select your theme’s functions.php file and add the following PHP snippet:

add_action( ‘phpmailer_init’, ‘my_phpmailer_smtp’ );

function my_phpmailer_smtp( $phpmailer ) {

    $phpmailer->isSMTP();

    $phpmailer->Host = SMTP_SERVER;

    $phpmailer->SMTPAuth = SMTP_AUTH;

    $phpmailer->Port = SMTP_PORT;

    $phpmailer->Username = SMTP_USERNAME;

    $phpmailer->Password = SMTP_PASSWORD;

    $phpmailer->SMTPSecure = SMTP_SECURE;

    $phpmailer->From = SMTP_FROM;

    $phpmailer->FromName = SMTP_NAME;

}

To send an email with custom headers, HTML content, and attachments, update the my_phpmailer_smtp function as follows:

add_action( ‘phpmailer_init’, ‘my_phpmailer_smtp_with_attachments’ );

function my_phpmailer_smtp_with_attachments( $phpmailer ) {

    $phpmailer->isSMTP();

    $phpmailer->Host = SMTP_SERVER;

    $phpmailer->SMTPAuth = SMTP_AUTH;

    $phpmailer->Port = SMTP_PORT;

    $phpmailer->Username = SMTP_USERNAME;

    $phpmailer->Password = SMTP_PASSWORD;

    $phpmailer->SMTPSecure = SMTP_SECURE;

    $phpmailer->From = SMTP_FROM;

    $phpmailer->FromName = SMTP_NAME;

    // Adding custom headers

    $phpmailer->addCustomHeader(“X-Mailer: My Custom Mailer”);

    $phpmailer->addCustomHeader(“X-Priority: 1”);

    // Setting HTML content

    $phpmailer->isHTML(true);

    $phpmailer->Body = ‘<h1>Hello,</h1><p>This is an email sent from WordPress without a plugin.</p>’;

    // Adding attachments

    $phpmailer->addAttachment(‘/path/to/file.pdf’, ‘Example.pdf’);

}

Save your changes.

5. Test

After saving the changes, test your configuration by sending an email using WordPress’ built-in wp_mail() function:

wp_mail(“[email protected]”, “Subject”, “Message content”);

This will send an email through your configured SMTP server using your set credentials.

Best plugins for sending emails in WordPress

Email plugins provide more customization than what’s offered with the default WordPress send email function. 

Depending on the plugin you choose, you’ll be able to:

  • 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.

You may also be looking for an automated email marketing solution or a mass email service to reach a wider audience.

So, here are the best email plugins on the market:

Omnisend — best for boosting sales

Omnisend is a comprehensive email platform that efficiently integrates with WordPress. You can use it for both transactional and marketing emails. 

It’s the perfect tool for increasing sales on your website. You can set up an automated welcome email series and autoresponders, items-in-cart reminders, product recommendations based on a shopper’s past purchases, and more. 

Plus, you’ll have access to in-depth analytics. You’ll be able to see the open rates, conversion rates, and other key performance metrics for each email campaign you set up. 

Once you create your Omnisend account, go to Campaigns and click to create a new one:

WordPress send email: Omnisend campaigns

Then, choose a campaign type like email:

Omnisend campaign types

Provide your subject line, sender’s name, and other details:

Omnisend email campaign

Then, choose a pre-designed template. You can filter options based on your goals and the theme:

Omnisend templates

You can then edit the content with your text and images, choose your audience segment, and schedule your email.

Automate your marketing emails with Omnisend to boost sales

Quick sign up | No credit card required

WP Mail SMTP plugin — best for email logging

WP Mail SMTP reconfigures your WordPress site to use an SMTP provider when sending emails. It integrates with a variety of SMTP services, including Zoho Mail, Mailgun, Sendgrid, and Gmail.

Once you install the plugin on your site, you can launch the setup wizard to help you get started:

WordPress send email: WP mail SMTP

You’ll need to choose a provider and configure its settings, including the “From” name and email address. It’s a good idea to send a test email when you’re done to make sure everything works as expected.

WP Mail SMTP Pro unlocks even more features, such as email logging, which lets you verify whether your email was successfully delivered and view details on clicks and opens.

You’ll also get advanced email reports, smart conditional routing, and more.

Post SMTP plugin — best for beginners

Post SMTP enables you to replace the default PHP mail function (wp_mail) with the SMTP mailer of your choice. It uses OAuth 2.0 (open authentication), so you can configure any service (like Gmail, Brevo, Mailgun, etc.) securely via API Keys.

You won’t need to provide your SMTP account credentials, so setup is quick. Simply choose your mailing provider:

Choose SMTP mailer

Then, enter the From Name and email address, and the API details of your chosen providers:

configure mailer settings

Once you’ve connected to the SMTP mailer, you can send a test email to make sure messages are being delivered. 

The plugin comes with other features, including advanced reporting, email logs, and instant email failure notifications.

How to test email sending in WordPress

By testing email sending in WordPress, you can find out whether your messages are making it into your recipients’ inboxes. Let’s look at some methods you can use:

Outgoing email logging

One of the most effective ways to verify email delivery is by using email logging. Many SMTP plugins, like WP Mail SMTP, provide built-in email logging features. 

After sending a test email, navigate to the Email Log section to track its delivery status:

WP mail log

Here, you can navigate to the Sent tab to see which emails were successfully delivered, or the Failed tab to view a list of messages that weren’t sent. 

You can also track email clicks and opens, save detailed email headers, and view more delivery information on each individual email. 

WordPress password reset

A quick way to test email functionality is through the password reset feature. Go to your login page (e.g., yourdomain.com/wp-login.php) and click on Lost your password? as shown here:

password reset

Then, enter your email address and click on Get New Password. You should receive an email with a password reset link. 

PHP Script

For a more advanced testing method, you can send emails directly using a PHP script. This involves creating a simple PHP file and running it locally or via the server.

Save the following script as a test-php-mail.php file:

<?php

ini_set(‘display_errors’, 1);

error_reporting(E_ALL);

$from = “[email protected]”;

$to = “[email protected]”;

$subject = “PHP Mail Test”;

$message = “It works! You can send email using PHP Mail”;

$headers = “From:” . $from;

mail($to, $subject, $message, $headers);

echo “Test email sent successfully”;

?>

Then, run the script by navigating to yourdomain.com/test-php-mail.php in your browser. Check for any errors displayed at the top of the page.

Troubleshooting email sending issues in WordPress

It’s frustrating when you try to send an email in WordPress, but it doesn’t work the way you want it to. There are a few common issues that frequently come up when sending WordPress emails. 

Below, we will discuss what those issues are and how to fix them:

Emails going to spam

A common problem that comes up when using WordPress for emails is that your emails go to the spam folder. Fortunately, you can take steps to ensure your emails reach the inbox of whoever you send them to in a couple of ways. 

To avoid your emails being marked as spam by inbox providers, make sure that your From name is a legitimate email and matches your domain name. 

For example, if your WordPress site is “deliciouscakes.com”, your From address should be “[email protected]” and not “[email protected].”

If you’re using an email address that looks spammy, it will likely go to the junk folder. Ideally, you should choose a hosting plan that includes a custom email address based on your domain name. 

You’ll also want to avoid spammy words like “Your FREE account is ready!” in your email subject line and message body. Additionally, make sure that your email body is not made up of a single large image or that you’re not using ALL CAPS text. 

Lastly, authenticating your email address could prevent your emails from going into spam, as an email that isn’t authenticated won’t reach the inbox of the people you send it to.

Server configured incorrectly

Your WordPress server may not have the proper configuration to send emails, which can prevent your messages from reaching their recipients. Luckily, you can check whether your server has the correct PHP mail() function enabled.

If there’s a server configuration issue, you can resolve it by installing a WordPress SMTP plugin. Omnisend offers a service to help you send emails reliably, ensuring they reach the intended recipients.

Using a third-party SMTP plugin allows emails to move across different networks while keeping them linked to your website. This means your emails are sent through another server, bypassing any restrictions imposed by your hosting provider.

Issues with contact form plugins

Your emails aren’t going to a spam folder, and you’ve resolved server issues. So why are they still not reaching your customers? 

You might be facing problems with your contact form plugin. Since there are several different contact form plugins available for your site, the solution depends on which one you’re using. 

Fixing contact form plugin issues can significantly improve customer engagement, so it’s essential to address this problem as soon as possible. Many plugins provide step-by-step troubleshooting guides to help fix email sending issues.

With some plugins, the fix may be as simple as changing your email address. Other forms may include trying to send and receive your emails from the same address. 

Since each one has its slight differences, you’ll need to check the help or troubleshooting guides for the specific plugin you use or contact the customer service team to resolve emailing problems in WordPress.

Plugin conflicts

Sometimes, similar WordPress plugins conflict with each other. For example, if you’re using multiple plugins for email delivery, like an SMTP plugin and a contact form plugin, they may interfere with one another, resulting in failed email sends.

To troubleshoot, deactivate all plugins related to email sending. Then, reactivate them one by one, testing the email functionality after each activation.

Once the conflicting plugin is identified, decide whether to replace it or adjust its configuration.

Always ensure that your plugins are updated, as outdated versions are more prone to conflicts.

WP emails failing to send

When your WordPress emails fail to send, the problem often lies in the server or email configuration. 

Common causes include:

  • Disabled PHP mail functions. Some hosting providers disable key PHP functions like mail() for security reasons. Without these, WordPress cannot send emails.
  • Email sending limits: Shared hosting servers often impose limits on the number of emails that can be sent in a given period. If you exceed this limit, further attempts to send emails will be blocked.

The solution is to switch to SMTP. Using an SMTP server bypasses these limitations and provides a more reliable infrastructure for email delivery. 

Configure your site to send emails via an SMTP service, as outlined in earlier sections. This ensures that your emails aren’t reliant on PHP mail functions or hosting server constraints. 

Conclusion

If you’re sending emails through WordPress, you might encounter deliverability issues, like your messages ending up in spam or not arriving at all. This can be due to server misconfiguration and email limits.

The solution is to implement SMTP. You can do this by installing a plugin like WP Mail SMTP (the easiest option). Alternatively, you can manually configure SMTP settings in your site’s wp-config.php file. 

For improved email marketing performance and deliverability, consider using a platform like Omnisend. With Omnisend, you can create automated email campaigns, segment your audience based on behavior and preferences, and much more.

Get started with Omnisend today & drive sales on autopilot with pre-built automation workflows

Quick sign up | No credit card required

Bernard Meyer
Article by

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.


Start free

What’s next

Related articles
10 best WordPress email subscription plugins in 2025
9 best WordPress newsletter plugins (free & paid)
50+ best WordPress plugins in 2025 [free & paid]
Subscribe and don’t miss any updates!

No fluff, no spam, no corporate filler. Just a friendly letter, twice a month.