I use the built in mail functions twice in one page to send two emails. I am having issues because most of the time it works but every once and a while it errors. Could this issue because I call two mail functions back to back? I can't get any detailed error because this is an existing system and the client doesn't want to pay for me to re design this using the smtp mail function. I have checked the error logs on the server and there is nothing in there at a time when the email errors. Does anyone have any idea of how I can trouble shoot this or thoughts on why this errors only sometimes? Here is the code it's very simple
// send email to proferrin
mail($adminto, $adminSub, $adminText, $adminHead);
// if (mail($adminto, $adminSub, $adminText, $adminHead)) throw new Exception('admiin receipt failed');
// send email to customer
mail($billingto, $billingSubject, $billingText, $billingHeaders);
// if (mail($billingto, $billingSubject, $billingText, $billingHeaders)) throw new Exception('customer receipt failed');