Categories
WordPress

Change Default From Address in WordPress : 2 Methods

Change Default From Address in WordPress by the two methods I am going to list below. Default From address is sometimes like [email protected] when it send email to any user.

Method #1

Put this code in your theme's functions.php File at the end after ?> & change [email protected] and Ahmad Awais

 

<?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 'Ahmad Awais';
}
?>
Method #2
Put this code in your theme's functions.php File at the end after ?> and admin Email will be used :)
<?php
add_filter('wp_mail_from', 'new_mail_from');

function new_mail_from($old) {
$admin_email = get_option('admin_email');
return $admin_email;
}
?>
 
 

By Freakify Editorial

The post was written by Freakify Team.

This blog used to be managed by Ahmad Awais before it was acquired.

I have had been designing web pages since the early days of tables & spacers. And No – I’ve never used the scrolling marquee with Comic Sans fonts . Well, I am an Entrepreneur who left his orthodox path of Electrical Eng after graduation to become a UX Engineer/Marketer & a Motivational Speaker. Read more about me at AhmadAwais.com

6 replies on “Change Default From Address in WordPress : 2 Methods”

Comments are closed.