foreach ($to as $rcpt_to) { $rcpt_to = $this->get_address($rcpt_to); if (!$this->smtp_sockopen($rcpt_to)) { $this->log_write("error: cannot send email to ".$rcpt_to."/n"); $sent = false; continue; }
if ($this->smtp_send($this->host_name, $mail_from, $rcpt_to, $header, $body)) { $this->log_write("e-mail has been sent to <".$rcpt_to.">/n"); } else { $this->log_write("error: cannot send email to <".$rcpt_to.">/n"); $sent = false; }
fclose($this->sock);
$this->log_write("disconnected from remote host/n"); }
return $sent;
}
/* private functions */
function smtp_send($helo, $from, $to, $header, $body = "") { if (!$this->smtp_putcmd("helo", $helo)) {