AHMED SAMY
asked on
i need to send emails using interval way
i need to send emails using interval way
i have email list i need to Periodically send email to this list 70 email in hour
how i can do
i have email list i need to Periodically send email to this list 70 email in hour
how i can do
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is it right
require "connection.php";
$sql="SELECT * FROM newsletter WHERE news_type=0";
$query=mysqli_query($conn,$sql);
while($row=mysqli_fetch_array($query)){
set_time_limit(20);
$emails = $row['email'];
$to = $emails;
$subject = "****";
$txt = "*******";
$headers = "From: *****";
mail($to,$subject,$txt,$headers);
$sql="UPDATE newsletter SET news_type='sent' WHERE email='$emails' ";
$query=mysqli_query($conn,$sql);
sleep(55);
}
?>
I would change the set_time_limit(20) to set_time_limit(60) - in other words more than your sleep time. You could also bring the set_time_limit() outside the loop as set_time_limit(3600)
Other than that the script should be fine.
Other than that the script should be fine.
ASKER
thanks i will try it
ASKER