HTML E-Mail as fileattachment
- by johnny
I have a Problem with Outlook 2010.
I sent an E-Mail with a Contactform with this Code:
$message = '
<html>
<head>
<title>Anfrage ('.$cfg->get('global.page.title').')</title>
<style type="text/css">
body { background:#FFFFFF; color:#000000; }
#tbl td {
background:#F0F0F0;
vertical-align:top;
}
#tbl2 td {
background:#E0E0E0;
vertical-align:top;
}
</style>
</head>
<body>
<p>Mail von der Webseite '.$cfg->get('global.page.title').'</p>
<table id="tbl">
<tr>
<td>Absender</td>
<td>'.htmlspecialchars($_POST['name']).' ('.htmlspecialchars(trim($_POST['email'])).')</td>
</tr>
<tr id="tbl2">
<td>Betreff:</td>
<td>'.htmlspecialchars($_POST["topic"]).'</td>
</tr>
<tr>
<td>Nachricht:</td>
<td>'.nl2br(htmlspecialchars($_POST["message"])).'</td>
</tr>
</table>
</body>
</html>';
$absender = $_POST['name'].' <'.$_POST['email'].'>';
$header = "From: $absender\n";
$header .= "Reply-To: $absender\n";
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
$header .= "X-Sender-IP: " . $_SERVER["REMOTE_ADDR"] . "\n";
$header .= "Content-Type: text/html; Charset=utf-8";
$send_mail = mail($cfg->get('contact.toMailAdress'), "Anfrage (".$cfg->get('global.page.title').")", $message, $header);
//$send_mail = mail("[email protected]", "Anfrage (".$cfg->get('global.page.title').")", $message, $header);
$_SESSION['kontakt_form_time'] = time();
$tpl->assign("mail_sent", $send_mail);
When I sent the email, doesn't shows the message. it generates a File named [NAME].h. The Message is in this File. How can I fix that, that the message shows in the E-Mail. Is this a Problem about the settings in Outlook?