How to Change wp_mail_from and wp_mail_from_name WordPress

The wp_mail_from (an email address) filter modifies the “from email address” used in an email sent using the wp_mail function. When used together with the ‘wp_mail_from_name‘ (the real name given to the email address) filter, it creates a from address like “TechPulseToday <info@techpulsetoday.com>”. The filter should return an email address. Just adding this below code to functions.php of your WordPress theme will change the from address in your WordPress theme or You don’t even need to mess with a file editor and FTP for this.  I would simply go to the Appearance > Editor menu in the WP Admin Panel, then find ‘functions.php’ in the list of theme files on the right.  Add these filters and you are in business. Two Important notes, 1. Make sure the email is from the same domain, 2. As your website to avoid being marked as spam.

wp_mail_from:

wp_mail_from_name:

 

Vijayan J

Thanks for stopping by guys! I’m Vijayan and Techpulse is my beloved brainchild.
Currently working as a PHP developer in a digital marketing start-up, I’m overly passionate about not just learning new things but also putting those into practice. I swear by a quote I once came across…
‘What separates successful people from unsuccessful people is the former’s ability to execute’.
Feel free to reach out to me if you have any questions, suggestions or feedback. Hoping to see more of you here!