Get Admin Email address

$from_email = get_option( ‘admin_email’ ); // this function get user email from wp_options table, when user change email address so that’s not working

$blogusers = get_users( ‘role=administrator’ );
// Array of WP_User objects.
$user_email=array();
foreach ( $blogusers as $user ) {
$user_email[]=$user->user_email;
}
$from_email=implode(“,”,$user_email);

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: