How To Send E-mail To All Registered Users in WordPress?

How are you all? I hope all of you are fine. Once again I presented with a small tune of WordPress. And that is how to send E-mail to all registered users of your site in same time. Before giving new tune I gave my previous tunes link, I hope those who have missed it will work for them.

Send E-mail To All Registered Users

Send E-mail To All Registered Users
Send E-mail To All Registered Users

E-mail marketing is one of the ways of bringing visitors in online. Through E-mail, you can bring visitor direct in your site. So through E-mail, if you want to inform all registered users then this tune is for you.

If you want to inform to all registered users through E-mail about bringing new tune of the site then using the following tutorial you can do that easily.

Paste following code in function file functions.php  of your theme.

function email_members($post_ID)  {

global $wpdb;

$usersarray = $wpdb->get_results(“SELECT user_email FROM $wpdb->users;”);

$users = implode(“,”, $usersarray);

mail($users, “New WordPress recipe online!”, ‘A new tutorial have been published on http://www.YOURDOMAIN.com‘);

return $post_ID;

}

add_action(‘publish_post’, ’email_members’);

Don’t forget to write the name of your site which is situated in below. IT Education is-my site’s link. Give like mistakenly and visitors will come in my site.

 Thank you all.