I have a simple script that loops through a list of devices and pings them. If the host does not respond, it is added to an array. Once the script ends I would like to send an email with the array results in the body text. I can't figure out how to print the array into the email body. The email is being generated and sent ok. The script builds an array called "$skipped[]". At the end of script execution I have an array with hosts in it like the following. Any ideas would great!
Array
(
[0] => houston3845vg
[1] => houstonfondren2811
[2] => houston2811
[3] => houstonfondren2811vg
)
Here is the mail function
function sendHostBackupStatus($time, $number, $skipped){
global $functions;
$date = date("m/d/Y h:i:s A");
$email = "Mike <mike@domain.com>";
$fromname = $functions->readConfigOption("email_from_name");
$fromaddress = $functions->readConfigOption("email_from_address");
$from = "From: $fromname <'$fromaddress'>";
$subject = "".SITE_NAME." - Host Configuration Archive Status";
$body = "<html>"
."<head>"
."<title>IPDB Host Backup Status</title>"
."</head>"
."<style>"
."table.email {background: white; width: 100%; border-collapse:collapse; font-family:arial; font-size:10pt}"
."th.email {background: cornflowerblue; text-align: left; padding: 3px}"
."tr.email {background: whitesmoke; text-align: left; vertical-align: top}"
."td.email {text-align: left}"
."td.emailfooter {text-align: right; font-size: 10px; padding: 3px}"
."tr.emailfooter {background: cornflowerblue; padding: 3px}"
."</style>"
."<table id=\"emailbody\" class=\"email\">"
."<th id=\"title\" colspan=\"2\" class=\"email\"><strong>Title</strong></th>"
."<tr class=\"email\"><td colspan=\"2\" class=\"email\">Informational Alert for Host Configuration Backups</td></tr>"
."<th id=\"details\" colspan=\"2\" class=\"email\"><strong>Details</stong></th>"
."<tr class=\"email\"><td class=\"email\">Status: </td><td class=\"email\"><font color=green>Complete</font></td></tr>"
."<tr class=\"email\"><td class=\"email\">Details: </td><td class=\"email\">This program archives all hosts configurations to the IPDB database. Please do not reply to this email.<br>"
."$number hosts had their configurations backed up.<br>"
."Backup completed in ".$time." seconds.<br></td></tr>"
."<tr class=\"email\"><td class=\"email\">Skipped Hosts: </td><td class=\"email\">None</td></tr>"
."<tr class=\"emailfooter\"><td colspan=\"2\" class=\"emailfooter\">Generated on $date UTC</td></tr>"
."<tr><td colspan=\"2\" class=\"emailfooter\">Generated by <strong><a href=\"http://lnx01/ipdb\">BMHC IPDB</strong></a></td></tr>"
."</table>"
."</html>";
/* In case any of our lines are larger than 70 characters, use wordwrap() */
$body = wordwrap($body, 70);
$headers = "MIME-Version: 1.0 . \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 . \r\n";
$headers .= "From: $from\r\n";
return mail($email,$subject,$body,$headers);
}