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 the Freakify Editorial Team.

Freakify.com used to be managed by Awais, Maedah and their team before its acquisition.

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

Comments are closed.