diff --git a/mail.php b/mail.php index 56d40a6..abc312f 100644 --- a/mail.php +++ b/mail.php @@ -18,3 +18,32 @@ function send_mail($an, $betreff, $text, $ok = '', $error = '') { } } +function send_html_mail($an, $betreff, $text, $ok = '', $error = '') { + $boundary = md5($an.$betreff.$text.time()); + include 'secret.php'; + $sender = 'noreply@troy-grunt.de'; + if (isset ( $_sendermail )) { + $sender = $_sendermail; + } + $header = 'From: ' . $sender . "\n"; + $header .= 'To: ' . $an . "\n"; + $header .= 'Content-Type:multipart/alternative;boundary='.$boundary . "\n"; + $header .= 'X-Mailer: PHP/' . phpversion (); + $content = "This is multipart message using MIME\n"; + $content .= "--" . $boundary . "\n"; + $content .= "Content-type: text/plain;charset=utf-8\n"; + $content .= 'Content-Transfer-Encoding: 8bit' . "\n\n"; + $content .= strip_tags($text)."\n\n"; + $content .= "--" . $boundary . "\n"; + $content .= "Content-type: text/html;charset=utf-8\n"; + $content .= "Content-Transfer-Encoding: 8bit". "\n\n"; + $content .= ''.$text.''."\n\n"; + + if (mail ( $an, $betreff, $content, $header ) === true) { + echo $ok; + } else { + echo $error; + } +} + +?> \ No newline at end of file