send email on specific day
Posted: Sat Feb 20, 2010 2:22 pm
hi i have a simple email sending script for my site members. it works fine in all sections of my site now i want to use the same script to send weekly newsletter to all my site members.
here is my email sending script
problem is that i want to specify a time to send email automatically means i want to send the newsletter on every saturday of the week.
could anyone help me how to set the time for send the automated mail on every saturday?
here is my email sending script
Code: Select all
<?PHP
$SQL_UGET = mysql_query("SELECT * FROM subscribers");
$NUM_UGET = mysql_num_rows($SQL_UGET);
if($NUM_UGET > 0){
while($ROWS_UGET = mysql_fetch_array($SQL_UGET));{
$UEMAIL = $ROWS_UGET['email'];
}
}
$msg = 'here goes my newsletter message';
$to = $UEMAIL;
$from = "My Site Name";
$sub = "weekly newslatter";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:'.$from."\r\n";
$smail = mail($to, $sub, $msg, $headers);
?>could anyone help me how to set the time for send the automated mail on every saturday?