I've been writing a number of PHP pages that involve using mail(). For the most part, it works well. However, occasionally (I'd say about 10-20% of the time), the mail() function causes the page to load exceptionally slowly, if at all.
I haven't been able to find a similar problem on forums anywere. Just to reiterate, the mail() function works fine and sends mail, but when calling scripts with the mail() function in it, it occasionally causes slow page load times.
Here's the important bits of what the pages look like. And for the record, we are using Microsoft Exchange Server 2007.
<html>
<head>
<?php
if ($_POST['submit'] == 'submit'){
//execute some php code.
mail($to, $subj, $body, $headers, "O DeliveryMode=b");
}
?>
<meta http-equiv="refresh" content="0">
<?php
}
</head>
<body>
<form action=<?php echo $_SERVER['PHP-SELF']?>>
<!--Form Data-->
<input type='submit' name='submit' value='submit'/>
</form>
</body>
</html>