function smtp_send($header, $body)
{
include "smtp.inc.php";
// Load code only if asked
$smtp = new SMTP();
$smtp->do_debug = $this->SMTPDebug;
// Try to connect to all SMTP servers
$hosts = explode(";", $this->Host);
$x = 0;
$connection = false;
while ($x < count($hosts)) {
if ($smtp->Connect($hosts[$x], $this->Port, $this->Timeout)) {
$connection = true;
break;
}
// printf("%s host could not connect<br>", $hosts[$x]); //debug only
$x++;
}
if (!$connection) {
$this->error_handler("SMTP Error: could not connect to SMTP host server(s)");
}
$smtp->Hello($this->Helo);
$smtp->Mail(sprintf("<%s>", $this->From));
for ($x = 0; $x < count($this->to); $x++) {
$smtp->Recipient(sprintf("<%s>", $this->to[$x][0]));
}
for ($x = 0; $x < count($this->cc); $x++) {
$smtp->Recipient(sprintf("<%s>", $this->cc[$x][0]));
}
for ($x = 0; $x < count($this->bcc); $x++) {
$smtp->Recipient(sprintf("<%s>", $this->bcc[$x][0]));
}
$smtp->Data(sprintf("%s%s", $header, $body));
$smtp->Quit();
}