egturnkey Posted March 6, 2010 Share Posted March 6, 2010 Hello friends, the following is a send email function $subject = "subject here"; $message = "message here"; $headers = "From: "."{$mailscript}\r\n"."Reply-To: "."{$mailscript}\r\n"."X-Mailer: PHP/".phpversion( ); @mail( $mailgust, $subject, $message, $headers ); how can i make it send every X time i can make a compare btween time now by let $timestamp = mktime($timestamp); and set certain time $timestamp1 = mktime(0, 0, 0, 12, 20, 2010); and if it > then it then it send but this is for specific time :-\ but i want it send every X time ( says week ) .. so any help here. thanks friends Link to comment https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/ Share on other sites More sharing options...
MatthewJ Posted March 6, 2010 Share Posted March 6, 2010 Use CRON to run the mail script on the specified interval? Hard to follow the actual question Link to comment https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/#findComment-1022185 Share on other sites More sharing options...
egturnkey Posted March 6, 2010 Author Share Posted March 6, 2010 Use CRON to run the mail script on the specified interval? Hard to follow the actual question thanks for your reply, but i don't wanna use cronjob i wonder if there was a way that i can make for examle an array let the time now is $timestamp = mktime($timestamp); so can i make array it send for example when it = any of the following times $timestamp1 = mktime(0, 0, 0, 12, 20, 2010); and $timestamp1 = mktime(0, 0, 0, 12, 21 2010); and $timestamp1 = mktime(0, 0, 0, 12, 22, 2010); ect it just an idea i don't know if it possible or not so if it can be then can anyone help me how to write it Link to comment https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/#findComment-1022188 Share on other sites More sharing options...
MatthewJ Posted March 6, 2010 Share Posted March 6, 2010 Since php is a server side language, are you suggesting that you would just tell the script to continuously run? Obviously because of script timeouts that won't work, so either way you are going to have to have something kick the script off to check the time? Are you prejudiced against cron for some reason? Link to comment https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/#findComment-1022189 Share on other sites More sharing options...
egturnkey Posted March 6, 2010 Author Share Posted March 6, 2010 Since php is a server side language, are you suggesting that you would just tell the script to continuously run? Obviously because of script timeouts that won't work, so either way you are going to have to have something kick the script off to check the time? Are you prejudiced against cron for some reason? I will insert it as a code within a php file say manal.php then once someone call that file website.com/manal.php the function should compare the time then will send it act like a call back functions, or protection functions for scripts..ect but it indeed has many usefull ideas. thanks you Link to comment https://forums.phpfreaks.com/topic/194302-send-email-every-x-time/#findComment-1022191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.