I am trying to generate an e-mail that will be sent to an e-mail address depending on the result. I am generating an XML document with PHP, and if the result length for the XML is 0 (meaning there was an error), I want to send it to one address. If not, I want to send it to another.
This is how I am sending the e-mail now:
$toaddress = 'mail#1@blah.com; mail#2@blah.com';
$toArray = explode(";", $toaddress);
for ($x = 0; $x < count($toArray); $x++)
{
$mail -> AddAddress(trim($toArray[$x]));
}
This sends the e-mail to both addresses. How would I make that so that, depending on the XML result, it would send it to one or the other? Thanks.