([^<]*))?(.*)$|ism', $content, $matches); $subject = $matches[2]; $body = $matches[3]; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . param('site email name') . " <" . param('site email address') . ">\r\n"; $t = microtime(); $t = explode(' ', $t); $t = str_replace('.', '', $t[0]); $filename = 'mails/mail-' . date('Y-m-d-H-i-s-') . $t . '.html'; $handle = @fopen($filename, 'w'); if ($handle !== false) { ob_start(); echo "$subject$body
" ; echopre("To: $to"); echopre('Headers:'); echopre($headers); echo ''; $gz = ob_get_contents(); ob_end_clean(); fwrite($handle, $gz); @fclose($handle); } return @mail($to, $subject, $body, $headers); } function email_valid($email) { if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { return false; } return true; } ?>