function sendMail($from, $to, $subj, $msg, $hdrs) { $smtpmail = new SMTPmail(); $smtpmail->smtp_host = 'bobo.semilogic.com'; $smtpmail->smtp_host = 'localhost'; if (!$smtpmail->send($to, $from, $subj, $msg, $hdrs)) { fail("Could not send email to {$to}!"); } }
function sendMail($from, $to, $subj, $msg, $hdrs) { $smtpmail = new SMTPmail(); $smtpmail->smtp_host = 'bobo.semilogic.com'; $msg = preg_replace("/\n/", "\r\n", $msg); $hdrs = preg_replace("/\n/", "\r\n", $hdrs); if (!$smtpmail->send($to, $from, $subj, $msg, $hdrs)) { echo "ERROR " . $smtpmail->ERROR_MSG . "Could not send email to {$to}!"; } }