'."\n".mysql_error()); } // echo($sql); //Send Mail //add From: header $headers = "From: panya.p@jasmine.com\r\n"; //specify MIME version 1.0 $headers .= "MIME-Version: 1.0\r\n"; //unique boundary $boundary = uniqid("HTMLMAIL"); //tell e-mail client this e-mail contains//alternate versions $headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n"; //plain text version of message //$body = "--$boundary\r\n" . // "Content-Type: text/plain; charset=windows-874\r\n" . // "Content-Transfer-Encoding: base64\r\n\r\n"; //$body .= chunk_split(base64_encode("This is the plain text version! ทดสอบครับ")); //HTML version of message $body .= "--$boundary\r\n" . "Content-Type: text/html; charset=windows-874\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $body_msg = ' Roaming Register on'.$startdate.'
Roaming Register report

Start Date: End Date:
'; $ir = 0; while ($row = mysql_fetch_assoc($s)) { $DateT=$row['status_date']; $APAC = $row['register']; $EMEA = 0; $TOTAL = 0; $ir++; $sql = "select register from m_roaming_register where status_date >=date_sub('".$DateT."',interval 2 minute) and status_date <= date_add('".$DateT."',interval 2 minute) and vlrnb='91870773001399' limit 1"; // echo $sql; $rr = mysql_query($sql); if ($row1 = mysql_fetch_assoc($rr)) { $EMEA = $row1['register']; } $TOTAL = $APAC+$EMEA; if (($ir % 2) == 0){ $color = '#A9A7A5'; } else { $color = '#F7F6F3'; } $body_msg .=' '; } $body_msg .='
Date Time APAC EMEA TOTAL
'.$DateT.' '.$APAC.' '.$EMEA.' '.$TOTAL.'
'; $body_msg .='
'; $body .= chunk_split(base64_encode($body_msg)); mysql_close($link); //send message //mail($to_email, "Top 50 destination & custgroup for cybervoice of ".$report_data_date, $body, $headers); //mail($to_email1, "Top 50 destination & custgroup for cybervoice of ".$report_data_date, $body, $headers); //mail($to_email2, "Top 50 destination & custgroup for cybervoice of ".$report_data_date, $body, $headers); //mail($to_email3, "Top 50 destination & custgroup for cybervoice of ".$report_data_date, $body, $headers); //echo "Report Send.
"; echo $body_msg; ?>