Category Archives: wordpress email

How to Change Sender Name in Outgoing WordPress Email

Do you want to change the default sender name and email address for outgoing WordPress emails?

By default, WordPress uses ‘WordPress’ as the sender name for all outgoing WordPress notification emails. This doesn’t look very professional, and you may want to change that to your business name.

In this article, we will show you how to easily change the default sender name and email address in outgoing WordPress emails.

Changing sender name and email address in outgoing WordPress emails

Why You Should Change the Default Sender Information in WordPress?

WordPress sends several email notifications to the site administrator as well as other users on your website.

This includes important email notifications such as forgot password emails, website error and recovery emails, new user registration, and more.

By default, it uses ‘WordPress’ as the sender’s name and a non-existent email address ([email protected]) as the sender’s email.

Many spam filters block your WordPress emails, believing them to be junk. Sometimes it does not even make it to the spam folder, but is deleted immediately due to filters.

For more on this topic, look at our guide on how to fix the WordPress not sending email issue.

The outgoing email notifications are important, and you should use your own brand and email address. This increases the authenticity of your brand and increases name recognition among your users.

For instance, if you run an online store, then you would want customers to get email notifications with your store name as the sender.

See our guide on how to get a free business email address for your website in 5 minutes.

Let’s see how to change the default sender name and email address in outgoing WordPress email notifications.

Method 1. Changing Default Sender Name and Email using WP Mail SMTP

This method is easier and recommended for all WordPress users.

For this method, we’ll be using the WP Mail SMTP Pro plugin. It is the best WordPress SMTP plugin, used by over 3 million website owners.

This plugin allows you to easily change the default sender name and email address for outgoing WordPress emails. It also helps you fix the WordPress email deliverability problem.

The first thing you need to do is install and activate the WP Mail SMTP Pro plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit WP Mail SMTP » Settings to configure plugin settings. Under the Mail section, you can simply enter the email address and the name you want to use to send WordPress emails.

Change sender name and email in WordPress using WP Mail SMTP

Below, you can find the options to set up an SMTP server to send WordPress emails. By default, the plugin will use the PHP method provided by your WordPress hosting company which is less reliable.

We recommend using any of the listed SMTP services to properly send WordPress emails for higher guaranteed deliverability.

Select Mailer

If you choose an SMTP service, then follow the on-screen instructions to connect the plugin with your SMTP service provider.

Don’t forget to click on the ‘Save Settings’ button to save your changes.

Test Your WordPress Emails

WP Mail SMTP Pro also allows you to test your WordPress email settings. Simply go to the WP Mail SMTP » Tools page and switch to the ‘Email Test’ tab.

Test WordPress emails using WP Mail SMTP

From here, you just need to provide an email address that you can access and then click on the ‘Send Email’ button.

The plugin will now send a test email to the address you provided. You can check your inbox to make sure that you can receive WordPress emails and that it has the correct sender name and sender email address.

WP Mail SMTP works with all popular WordPress plugins like WooCommerce, WPForms, and more.

For more detailed instructions, you may want to see our article on how to use SMTP to send WordPress emails.

Method 2: Changing Default Sender Name and Email using WP Change Email Sender

This method is only recommended if you don’t use an SMTP service or if the first method is not working.

Using this method does not improve your WordPress email deliverability or make it easier to troubleshoot email issues. However, if your WordPress emails are working, then it will allow you to change the sender name and email address.

First thing, install and activate the WP Change Email Sender plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to go to Settings » General in your WordPress admin area. There you’ll find the ‘Email Sender Name’ and ‘Sender Email Address’ fields.

WP Change Email Sender

You will need to enter the name and email address you want to be used for outgoing WordPress emails.

Don’t forget to click on the ‘Save Changes’ button to store your settings.

That’s all. Your WordPress notification emails will now show the name and email address you entered in the plugin settings.

There is no method provided by the plugin to test your email settings. You can do that by performing actions that generate WordPress notification emails, like creating a new user, requesting a password reset, and more.

Method 3: Changing Sender Name and Email Address using WPCode

Another excellent way to change your sender name and email address are by adding a code snippet. And we recommend WPCode, the easiest and safest way to add code to WordPress.

You usually need to add code to your functions.php file, but WPCode makes it simple and easy to add this code snippet with just a few clicks.

Not only that, but WPCode has many other snippets available to help customize your site. Plus, you can easily add your custom snippets.

First, you need to install the free WPCode plugin. For more information, check out our step-by-step guide on how to install a WordPress plugin.

Next, click on Code Snippets » Add Snippet to your WordPress admin dashboard. Simply type ‘sender’ into the search bar and press the ‘Use snippet’ button under ‘Change Outgoing Email Sender’.

WPCode Use Snippet

Then you’ll be taken to the Edit Snippet page.

Here you need to update the sender’s email and name in the code snippet.

WPCode Edit snippet

And then, switch the toggle to ‘Active’ and click on the ‘Update’ button.

One of the benefits of using WPCode is that it comes with a library filled with pre-made snippets. There’s a good chance you can find some to replace other plugins on your site, such as disabling automatic updates, allowing SVG files to be uploaded, or even using the Classic editor instead of the default block editor.

You don’t have to use the library, either. You can also add any other code you ever need by selecting ‘Add Your Custom Code (New Snippet)’ button instead of searching the library.

Add New Custom Snippet

Then, all you have to do is just paste your own code in and decide where it should run on your site.

For example, you can copy and paste this snippet below into the WPCode’s custom code snippet and customize it to change the sender name and email.

// Please edit the address and name below.
// Change the From address.
add_filter( 'wp_mail_from', function ( $original_email_address ) {
	return '[email protected]';
} );

// Change the From name.
add_filter( 'wp_mail_from_name', function ( $original_email_from ) {
	return 'Tim Smith';
} );

We hope this article helped you learn how to change the sender’s name and email address in outgoing WordPress emails. You may also want to see our guide on the best bulk email marketing services to bulk send emails to all your users and our comparison of the best WordPress page builder plugins to customize your site without any code.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Change Sender Name in Outgoing WordPress Email first appeared on WPBeginner.

How to Fix WordPress Not Sending Email Issue

One of the most commonly asked questions on WPBeginner is how to fix WordPress not sending email problem. Many of our beginner level users ask us why their contact form plugin is not sending emails, or why they are not seeing any WordPress notifications. In this article, we will show you how to fix WordPress not sending email issue.

Why You Are Not Getting Emails from Your WordPress Site

The most common reason for this is that your WordPress hosting server is not configured to use PHP mail() function.

Even if they would allow it to work, many email service providers use a variety of tools to reduce email spam. These tools often try to detect that an email is originating from the location it claims to be originating from, and often emails sent by WordPress websites fail this test.

In such cases, when an email is sent out from your WordPress site, it never even makes into spam folder of the destination. This is why we recommend not using WordPress to send your email newsletter.

This is also the reason why that we recommend using SMTP to send emails in WordPress. SMTP (Simple Mail Transfer Protocol) is the industry standard for sending emails. Unlike PHP mail function, SMTP uses proper authentication which increases email deliverability.

There are many different SMTP services available, but in this article we will show only two that we recommend: MailGun and Gmail.

Sending Your WordPress Emails Using Mailgun

Mailgun is a popular email service provider. They allow website owners to send large amounts of emails with high deliverability.

As a dedicated email service provider, they spend a lot of money and time on making sure that your email reaches its destination.

While Mailgun is a paid service, it offers first 10,000 emails for free every month. That’s more than enough for most folks who just started their blog or website.

Here is how to setup your WordPress site to use Mailgun for sending emails.

First you need to signup on the Mailgun website. After signing up, you need to click on the “Add your domain” button.

Add your domain to Mailgun

You will now see an add domain page. Here you need to add a subdomain on your WordPress website’s domain name. For example, mail1.yourdomain.com.

You can create a new subdomain on your existing domain name by following the instructions below.

First, you need to visit the cPanel dashboard of your hosting account. Next, click on the subdomains icon under the domains section.

cPanel subdomains

On the next page, you need to enter your subdomain and then select your root domain from the drop down menu.

Enter your subdomain

After that click on the create button, and you will see a success message that your subdomain has been created.

You can now add this subdomain on Mailgun’s add domain page. After you add the domain, Mailgun will show you a few DNS records.

Mailgun DNS records

Switch back to your cPanel dashboard and then click on ‘Advanced DNS Zone Editor’.

DNS zone editor

You will be asked to select the domain for which you want to change the DNS records. Once you select your root domain name, you will see options to add new DNS records.

The first TXT entry will be your subdomain. You need to start by entering the subdomain in the Name field and then select TXT as record type. After that you need to add 14400 in TTL field and copy the value shown on Mailgun domain verification settings page into TXT Data field.

Adding DNS TXT record

Repeat the process to add the other TXT record.

Once you are done, switch back to the cPanel dashboard and click on the MX Entry icon.

MX Entry icon in cPanel

You will be asked to select your root domain, then scroll down to the bottom of the page. There you will see the option to add a new MX Entry.

Enter the priority and destination values and click on create new record button.

You have successfully added your domain to Mailgun. It will need to verify that your domain has proper DNS records. This may take a while because DNS records may take sometime to update.

You can check the status of your domain verification by visiting the Domains page in your Mailgun account.

Mailgun will show active status next to your domain name once it can verify the DNS changes you made.

Mailgun active domains

Once your domain is active, you can setup your WordPress site to start using Mailgun for sending emails.

First thing you need to do is install and activate the WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » WP Mail SMTP to configure plugin settings. First you need to provide your sender email address and the name you want to use for the sender.

WP Mail SMTP settings

Next, you need to select Mailgun as your mailer and check the box next to set the return path to match the from email address.

Select Mailgun as your mailer

Lastly, you need to provide your Mailgun private API key and the mailgun sub-domain. Click on the links below each field to get this information from your Mailgun account.

API key and domain name

Don’t forget to click on save settings button to store your changes.

That’s all, you have successfully setup your WordPress site to send emails using Mailgun.

You can now click on the ‘Email Test’ tab on plugin’s settings page to send a test email and see if everything is working fine.

Email test

Sending WordPress Emails Using Gmail SMTP Servers

Another alternative is to send your WordPress emails is using Gmail SMTP servers. You can use any regular Gmail account with this method to send out your emails. However, your email deliverability will be much better if you are using Google Apps for Work with your custom email address. See our guide on how to setup a professional email address with Google Apps and Gmail.

Whether you use paid or free Gmail address, rest of the instructions are the same.

First, you will need to install and activate the WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » WP Mail SMTP page to configure plugin settings. First you need to provide your gmail address in the ‘From Email’ field and the name you want to display as sender.

WP Mail SMTP settings for Gmail

Next, you need to scroll down to the mailer option. There are two ways you can use Gmail servers to send WordPress emails.

First, method is to use Gmail APIs to send emails. This method is recommended because it is more secure and reliable. Second method is to use your Gmail account’s SMTP server manually.

We will show you both methods, however we recommend that you use the first method.

Method 1: Setting up Gmail to Send WordPress Emails Using OAuth Protocol

First, you need to select Gmail as your mailer under WP Mail SMTP settings page. Check the box next to set the return path to be the same as sender, not checking this box will make bounced and failed messages to be lost forever.

Select Gmail as Mailer

Next, you will see the option to enter your Client ID, Client Secret, and a URL in ‘Authorized redirect URI’ field.

Creating an App and Generate API Keys for Gmail

To use Gmail’s APIs for sending WordPress emails, you need to create an app and generate an API key. To do that, visit the Google Developers Console website and create a new project.

Create Google Developer Console project

If you don’t see the blue button to create a project, then you can also click on ‘Select a project’ drop down and create a new project.

You’ll be asked to provide a name for your project. Give it a meaningful name so that next time you are here, you can easily recognize it.

Name your project

Click on the create button to continue.

Developer console will now create your project and take you to its dashboard. Google allow developers to access many of their APIs and services. Now that your project is setup, you need to enable the APIs that you will be needing.

Enable APIs

Click on Enable APIs and services button to continue.

This will bring you to the APIs library page. Type Gmail in the search box to quickly find Gmail API and click to select it.

Select Gmail API

You will now see an overview of the API and what it can do. Simply click on the ‘Enable’ button to continue.

Enable Gmail API

Now that your API is enabled, the next step is to create credentials that you can use in your WP Mail SMTP plugin settings.

Click on the create credentials button to continue.

Create credentials

On the next screen, you will need to select ‘Web browser JavaScript’ in ‘Where you’ll be calling the API from’ field. After that click on the ‘User Data’ option.

To continue, click on the ‘What credentials do I need?’ button.

You will now be asked to provide a name for your OAuth client name. You can enter ‘WP Mail SMTP’ here.

Step 2 of API credentials

Under JavaScript origins field, add your website’s domain name. Next, you need to copy and paste the authorized redirect URL from WP Mail SMTP plugin settings.

Click on ‘Create client ID’ button to continue.

Next, you need to enter a name for OAuth consent screen. You can put the plugin’s name here.

API credentials step 3

Click on the continue button and developer console will show your client ID. You can copy it and paste it in WP Mail SMTP plugin’s settings page. However, you will still need client secret key.

Getting client ID

Click on the Done button to move on.

You will now be taken to your project’s credentials page. You will see your recently created credentials listed there. Click on the edit button next to your credentials.

Edit credentials

This will bring you to edit credentials page where you will be able to see your client secret key. You need to copy and paste the key in your plugin’s settings page.

Client secret key

Return back to plugin’s settings page in your WordPress admin area. Now that you have both client ID and client secret keys, you need to click on the save settings button to continue.

Save Api keys

The plugin will now store your settings and reload the page. After that you need to scroll down to the bottom of the settings page and click on the ‘Allow plugin to send emails using your Google account’ button.

Allow plugin to connect

This will take you to your account on Google and you will be asked to give the website permission to send emails on your behalf.

Allow WP Mail SMTP to send emails

After that you will be redirected back to your website where you will see a success message.

You have successfully set up WordPress to use Gmail SMTP servers for sending emails using the OAuth protocol. You can now click on the ‘Email Test’ tab on plugin’s settings page to send a test email and see if everything is working fine.

Email test

Method 2: Setting Gmail to Send WordPress Emails Using SMTP

This method allows WP Mail SMTP to manually connect to Gmail’s SMTP servers for sending WordPress emails.

First, you need to visit Settings &raquo WP Mail SMTP page to configure the plugin settings.

Provide the Gmail address you want to use as From email field and your name as from name field.

Gmail SMTP

Select ‘Other SMTP’ as your mailer and check the box next to return path.

Scroll down to Other SMTP section to configure more settings.

Gmail SMTP settings for WP Mail SMTP

Here is how to fill out the plugin settings:

  • SMTP Host: smtp.gmail.com
  • SMTP Port: 465
  • Encryption: Use SSL encryption
  • Authentication: Turn on authentication
  • Username: Your complete Gmail address, e.g. [email protected] or [email protected]
  • Password: Password of your Gmail account

Click on the save changes button to store your settings.

That’s all, you have successfully setup WP Mail SMTP to use Gmail SMTP servers.

You can now click on the ‘Email Test’ tab on plugin’s settings page to send a test email and see if everything is working fine.

Email test

We hope this article helped you learn how to fix WordPress not sending email issue, You may also want to see our list of the most common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix WordPress Not Sending Email Issue appeared first on WPBeginner.