Day wise mails in WordPress


/*Day wise mail start*/
add_action( ‘daily_schedule_expire_session’, ‘do_daily_schedule_expire_session’ );
add_action( ‘init’, ‘daily_schedule_expire_session’ );
function daily_schedule_expire_session() {
if ( ! wp_next_scheduled( ‘daily_schedule_expire_session’ ) ) {
wp_schedule_event( time(), ‘daily’, ‘daily_schedule_expire_session’);
}
}
function do_daily_schedule_expire_session(){
$user_email = “mail”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-Type: text/html; charset=ISO-8859-1\r\n”;
wp_mail($user_email, “test”, “testing”, $headers);
}
/*Day wise mail End*/
Advertisements

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