Monday, May 21, 2012 19:28 | OTWOMD is best viewed using Firefox or Google Chrome in 1024x768 screen resolution

7 easy steps in Changing your WordPress “from email address” or “sender email address”


Posted by on Saturday, October 2, 2010, 19:21
This item was posted in Cyberspace and has 0 Comments so far.

from-email-addressLately when I optimized and updated my database, the email address sent to my readers and subscribers reverted back to my webhost’s default email address. Let’s say for example that my host is bluehost or hostmonster, or  let’s say in WordPress, usually their generic email address when a comment notification is sent or any email newsletter is sent to my subscribers is like this:

username@host#.hostmonster.com or username@host#.bluehost.com or WordPress@domain.com

When the email is sent like this to your readers, commenters and subscribers, there is a high risk that your control and security over your blog will be compromised. In the case of the WordPress default header for email notifications, some bloggers tend to change this according to their preferences. So in order to prevent this email addresses from being sent to your recipients, there are a few easy steps for you to do in order to change it to your desired email address. I have been using this technique ever since I hosted my own blog and it is 100% efficient since you won’t be needing to change it every time you update your wordpress version, compared to other techniques that simply reverts to the old system once WordPress updates.

Upon reading other forum threads, I found out that some webhosts offer this solution:

This is because our servers require you (or your script) to use a properly formatted, valid From: header in your email. If the From: header is not formatted correctly, empty or invalid our system will change the from address to be @host#.webhost.com. To stop this, you must change the script you are using to correctly use a valid From header.

Examples of headers that should work would be:
From: user@domain.com
From:
From: “name”

Examples of headers that will NOT work:
From: “user@domain.com”
From: user @ domain.com

This solution above however is inefficient and doesn’t make sense. So here is an alternative solution for you that works in 5 easy steps:

STEP 1: Determine the email address that you will use. for the purpose of example, let’s assume that you want to use ignoramus@yoohoo.com as your preferred email address. Now make sure that this email is active and existent because if not, all of the steps below will be invalid and won’t work.

STEP 2: Replace the old email address with your new email address on your WordPress Control Panel. You can update the email address fields required in wordpress in three various locations; in User Profile, in General Settings and in Writing Settings.

To access User Profile go to Dashboard > Users > Your Profile > Contact Info > Email (required field)

Wordpress User Profile

 

To access General Settings go to Dashboard > Settings > General Settings >  then look for the Email field

WordPress General Settings

 

To access the Writing Settings go to Dashboard > Settings > Writing Settings > Post via e-mail > then look for the “Mail Server” field. Please take note that you only need to update the email address here if you are publishing blog post via your email account. If you haven’t activated this feature, don’t do anything on this field and leave it alone.

Writing Settings

Then save your changes for each settings.

STEP 3: Update your feed subscription email delivery settings. Let’s say you are using FeedBurner as your feed delivery system. Update the email address that you use in sending email subscriptions

STEP 4: Update plugins in your control panel that requires email addresses. Common plugins that require email addresses are contact form plugins, chat plugins, comment plugins, email notifications plugins etc.. once all of your emails has been updated, then its tme to go to the next step.

STEP 5: Locate in your wordpress root directory the file php.ini which is usually located under the public_html folder. Open the file and look for the following line which is usually on line 604

sendmail_path = /usr/sbin/sendmail -t -i

modify this line to

sendmail_path = /usr/sbin/sendmail -t -i -fignoramus@yoohoo.com

Remember: -f is the command option, followed by the email that you wish to use to send out emails. There should be no space between -f and your email or else it would not work.

Save the file.

Now you will notice that the address that is now being sent to you and your recipients whenever there are comments awaiting moderation or updates will be the one you used, as in our example, ignoramus@yoohoo.com

STEP 6 (OPTIONAL): Now if you want to use a custom name for your email address instead of just ignoramus@yoohoo.com,you can use this option. Now lets say you wanted to use the email name “IGNORAMUS UPDATES” for the email address. All you have to do is go to your themes directory that can be found on your WordPress control panel (Dashboard > Appearance > Editor). On the Theme Editor, locate the Theme functions or functions.php of your theme. Open the file and append this code anywhere on the file:

add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
return 'ignoramus@yoohoo.com';
}
function new_mail_from_name($old) {
return 'IGNORAMUS UPDATES';
}

Whereas you can change the ignoramus@yoohoo.com and the IGNORAMUS UPDATES value with your preferred email address and email sender’s name respectively.

Save the file and you are done.

STEP 7: test your email notification system by logging out from your WordPress control panel and submitting a comment anywhere on your blog post. Check your email and you will see the changes on your email delivery system.




You May Have Missed Reading This...




Be the first to read! SUBSCRIBE to our email list

Read our Privacy Policy

Leave a Reply