I doubt this is a problem with PHP's mail() function. I would be more inclined to check your control structure.
Since you didn't giva any details about what your code looks like, I'll make a few assumptions. Even with these assumptions, you should be able to use this technique to debug your application.
We'll assume you're using a for loop. If your app looks something like this now:
<pre>
for ($i = 0; $i < somefunc(); $i++)
{
mail($person, $subject, $message);
}
Then change it to this:
for ($i = 0; $i < somefunc(); $i++)
{
echo "This is iteration number '$i'. \n<br>";
}
I'll bet you find that you still have an infinite loop.
The reason I responded as such before is because I was having problems with the mail() function related to my SMTP server and the effects were the same as a loop. The page would never stop loading. Difference being that there were no emails being sent.
Hope this helps. If it doesn't, attach some code and people will be able to help more.
Matt Nuzum