PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$file = fopen("emails.txt","r");
while(! feof($file))
{
mail($file, 'Thanks for joining!', Hi\nWe are glad to see you onboard\n\nPrivateloader);
echo fgets($file). " - just received a email.<br>";
}
fclose($file);
?>
I have one other question how do i increase the time limitation of 30 seconds per execution in PHP?
I'm having problems running the whole script under 30 seconds.
sjuaq wrote:I have one other question how do i increase the time limitation of 30 seconds per execution in PHP?
I'm having problems running the whole script under 30 seconds.
You cannot really speed up how fast mail is sent. You probably need to call the script multiple times. Each call would only sends a small number of emails. But then, you will need to keep track of the number of the last email. It would be much easier with a database. Each record could have the email address and whether it had been send. Then just select the next N unsent email each call, and mark them in the database when they are sent.