the problem is to avoid the timeout
if (opc == 1)
{
if you can use an alias to a file with sendmail is easy, but u have to check some security options in sendmail
}
elseif (opc == 2)
{
you can try to reload the page, using a mix with javascript (reload) after you send some mails, and pass the last mail to know the last one
<? // loop sending mails ?>
<script>
href=mandomails.php?mail=<? $LastMailID ?>
</script>
}
else
{
echo "dont know";
}
sir jumapu