Changing the ‘from’ in notification emails

Stopping WordPress sending user notification emails to new members from ‘wordpress’ or using ‘wordpress@yourdomain.com’.

When WordPress processes member registrations it sends new members an email which includes confirmation of their registration, their username, password and login url. By default, these emails will befrom ‘WordPress’ and use the email address ‘wordpress @yourdomain’.

Apart from showing the wrong name, which is bad enough, many email services will dump these emails straight into the spam bin, deciding the sender details shown don’t match the real sender details. One of our personal email services seems to eat these notification emails – they never, ever arrive and we’ve never been able to understand why.

In any case, the good news is that it’s a simple problem to fix. You can either use a very simple plugin, or you can modify one of the files inside WordPress. The plugin route is the more popular choice, so we’ll look at that first.

WP Mail SMTP

wp-mail-smtp

Go into your WordPress ‘plugins’ page and click ‘add new’.  Search the plugins repository for the ‘WP Mail SMTP‘ plugin. Download and activate the plugin, then click ‘settings’ under the plugin name, or go to ‘settings’ in your admin menu and click ’email’. Both routes take you to the plugin setup page.

Setting the plugin up is simple – just fill in the various fields as shown below. If you choose to use SMTP you’ll need to enter the various details shown – if you’re not using your own mail server you’ll just need to check the settings with your email provider. If you want to use PHP mail you only need to add the site ‘from’ name, email address and that’s all. At the end, remember to save your settings and then test them by sending an email. If you’re still not convinced, go into your user section, create a new user and then check the email that WordPress sends out.

smtp-setup

Recent Posts

  • Plugin Review - WP Rocket

WP Rocket Review

Review - WP Rocket cache plugin In case you didn't already know, WP Rocket is a WordPress caching plugin and, unlike most cache plugins, is only available in a 'premium' [...]

  • WordPress Security

WordPress Security – 2

WordPress Security Plugins You can take care of the basics of WordPress security yourself, and it doesn't take long. The next step is to find a good, reliable security plugin [...]

  • WordPress Security

WordPress Security – 1

WordPress Security Out of the box, WordPress is a relatively secure publishing platform, but a magnet for hackers. Unless you want to find your site overrun by hackers on a [...]

  • feat-starter-plugs

Essential plugins at startup

Startup plugins and themes Like most people who create WordPress website regularly, we have what you might call a default approach and some essential plugins that we use. Basically, allowing [...]

Alternative Method

Using a plugin is undoubtedly the easiest option, but perhaps you don’t want to install yet another plugin. In that case, you can acheieve the same thing by editing the file ‘class-phpmailer.php’ which you’ll find in the ‘wp-includes/’ folder of your WordPress install. We use our hosting cpanel to access files like this but you can also do it via FTP.

Open class-phpmailer.php and scroll down a few lines (line 73 in our install) and find these two items:

public $From = ‘root@localhost’;
/**
* The From name of the message.
* @var string
*/

public $FromName = ‘Root User’;

The ‘public $From’ line will generate the email address WordPress uses. Change it, keeping the email address inside the existing single quotes and without spaces. The ‘public $FromName’ line generates the name your emails are shown as being from. Change this to whatever you want, keeping the name inside the single quotes. Spaces are okay. As an example, see below…

public $From = ‘members@wpheart.com’;
/**
* The From name of the message.
* @var string
*/

public $FromName = ‘WPHeart’;

The disadvantage of this method is you’ll need to remember to edit this file whenever your WordPress core files are updated, as WordPress will overwrite whatever you added. That said, it takes all of 10 seconds to open, type and save the changes, so it’s your call!