TUTORIAL How to change from email address and name

6.27K viewsGeneral
1

I was about to write some code in Email plugin, but then I thought it must have been implemented somewhere outside.

Indeed, there are other, simple ways to change default “from” and “name” fields for every email sent by your wordpress installation.

I have currently ended up using Postman SMTP Mailer/Email Log, it has overwhelmingly good reviews and my experience with is is pretty good so far. Log of all emails sent from wordpress is definitely a plus.

What I was required to do is simply fill “from email address” and “from name” fields.

 

Now my visitors get notifications not from WordPress <[email protected]>, but from proper Дима Стефанцов <[email protected]>

0

Or if you don’t actually want all those emails on your email client, just change the default from address and name https://wordpress.org/plugins/wp-change-default-from-email/

1

@Dima Stefantsov, Thanks for the info. Will certainly try it someday. Meanwhile, I overrided Email-id and name in my case by adding following filter in functions.php

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

function new_mail_from($old) {
    return '[email protected]';
}
function new_mail_from_name($old) {
    return 'MedicosHive Support';
}

 

Can you or Rahul tell me any added benefit for using the plugin instead of this filter.

Thanks.

Edit 1 : – I just re-read your post. Log of All Sent Mails is definitely a plus.

On my path to the solution I ended up currently, I found the likes of what you offer.
It is good, it should work, this is how few other simple plugins work.

I have few reasons why I haven’t stopped here.

1. I am a programmer. Therefore, I know best code is code not written.
If I implement it your way, it will be me who will have to maintain it. If I use plugin that have a history of support and large user base, there is very high probability any possible required change in future – will be done by not me.

2. Couldn’t be sure your way was enough. On my screenshot above you can see option “prevent plugins and themes from changing this”. It means there could be different behaviours. I am using MailPoet, and I do not want to take a bet, I do not want to debug.

Overwhelmingly positive reviews on Postman SMTP Mailer/Email Log tell me “most probably, this thing just works and never breaks”. Otherwise it would not be THIS many 5stars.

3. Always wanted to have a log of mails.

4. I know some time in future, when I will either grow, or when my hosting will end up in blacklist, I will need to start using 3rd party SMTP. This was a good chance to start using technology 1 step away from having 3rd party SMTP provider plugged in.

@Dima Stefantsov, thanks for the detailed explanation. I never knew this. I will definitely gonna try this plugin 🙂