Xen: Kontaktformular in HTML als Mail versenden

Beitrag lesen

Guten Morgen Leute,

hab ein kleines Problem wahrscheinlich ist es nur eine Kleinigkeit. Ich will mein Kontaktformular als HTML Mail versenden, jedoch bekomme ich den HTML Code geschickt. Kann mir jmd sagen was ich daran ändern muss um die Mail richtig angezeigt zu bekommen.

Hier der Code zum versenden:

<?php  
  
/*Variablen werden umgewandelt*/  
/*weitere Felder nach &auml;hnlichem Muster verwenden*/  
	$company = $_POST['company'];  
	$name = $_POST['name'];  
	$adress = $_POST['adress'];  
	$zip_code = $_POST['zip_code'];  
	$city = $_POST['city'];  
	$county = $_POST['county'];  
	$country = $_POST['country'];  
	$phone = $_POST['phone'];  
	$fax = $_POST['fax'];  
	$email = $_POST['email'];  
	$message = $_POST['message'];  
   	  
  
/*Hier werden alle Daten eingegeben*/  
/*An wen soll die Anfrage gerichtet sein?*/  
 $webmaster = "nico.felix@web.de";  
/* $webmaster = "info@schriftdruck.de";*/  
/*Welche E-Mail-Adresse soll als Absender eingegeben werden?*/  
 $absender = "info@schriftdruck.de";  
	  
/*Wie soll die Mail aussehen, die an den webmaster gerichtet ist? Formularfelder werden wie folgt eingef&uuml;gt "$NameDesFeldes"*/  
/*Betreff*/		$betreffwebmaster = "Message to Xpose Print Ireland";  
/*Textk&ouml;rper*/  	$koerperwebmaster = "  
<html>  
<head>  
<title>Xpose Print ::</title>  
  
<style type=\"text/css\">  
<!--  
body {  
	font-family:\"Verdana\", Arial, Helvetica, sans-serif;  
	color:#000000;  
	font-size:8pt;  
	background-image:url(../bilder/bg.gif);  
	background-repeat:repeat-x;  
	background-position:top;  
	background-color:#FFFFFF;  
}  
  
.titles { font-size: 12pt; color: #01827d; font-weight: bold;}  
  
.bold {color: #01827d; font-weight: bold;}  
  
.price {color: #e15914; font-weight: bold;}  
  
.next {font-size: 8pt; color: #e15914; font-weight: bold; letter-spacing:-1px;}  
a.next:link { color: #e15914; text-decoration: none; }  
a.next:visited { text-decoration:none; color:#e15914; }  
a.next:hover { color:#01827d; text-decoration:none; }  
a.next:active { color:#01827d; text-decoration:none;}  
  
  
a:link { color: #01827d; text-decoration: underline; font-weight: bold; letter-spacing:-1px;}  
a:visited { text-decoration:none; color:#01827d; }  
a:hover { color:#e15914; text-decoration:none; }  
a:active { color:#e15914; text-decoration:none;}  
  
-->  
</style>  
  
</head>  
<body>  
<table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">Company</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">$company</td>  
              </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">Name</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">$name</td>  
              </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">Address</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">$adress</td>  
              </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">ZIP Code</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">  
                  <table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  
                    <tr>  
                      <td width=\"200\">$zip_code</td>  
                      <td width=\"100\" style=\"padding-left:15px\"><span class=\"bold\">City</span></td>  
                      <td width=\"200\">$city</td>  
                    </tr>  
                  </table></td>  
			  </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">County</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">  
                  <table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  
                    <tr>  
                      <td width=\"200\">$county</td>  
                      <td width=\"100\" style=\"padding-left:15px\"><span class=\"bold\">Country</span></td>  
                      <td width=\"200\">$country</td>  
                    </tr>  
                  </table></td>  
			  </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">Phone</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">  
                  <table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  
                  <tr>  
                    <td width=\"200\">$phone</td>  
                    <td width=\"100\" style=\"padding-left:15px\" ><span class=\"bold\">Fax</span></td>  
                    <td width=\"200\">$fax</td>  
                  </tr>  
                </table></td>  
              </tr>  
              <tr>  
                <td width=\"100\" height=\"27\" valign=\"top\"><span class=\"bold\">eMail</span></td>  
                <td width=\"500\" height=\"27\" valign=\"top\">$email</td>  
              </tr>  
              <tr>  
                <td width=\"100\" valign=\"top\"><span class=\"bold\">Message</span></td>  
                <td width=\"500\" valign=\"top\">$message</td>  
              </tr>  
        </table>  
</body>  
</html>  
";  
  
/*Was soll nach dem Absenden des Formulares geschehen.  
1\. Verweis auf andere HTML- bzw. PHP-Seiten (bei $action eine 1 eintragen)  
2\. Anzeige direkt in der danke.php (bei $action eine 2 eintragen)*/  
$action = 2;  
  
/*Direkte Anzeige der Fehler in der danke.php  
Welche Fehlermeldung soll ausgegeben werden, wenn die E-Mail-Adresse falsch eingegeben wurde? Bitte mit HTML-Tags arbeiten,  
es k&ouml;nnen auch Klassen f&uuml;r CSS zugewiesen werden*/  
$mailfalsch = "<p class=titles>Fehler</p><p>Leider ist die E-Mail-Adresse falsch</p><p>Bitte kontrollieren Sie noch einmal die Eingabe und senden Sie das Formular erneut ab.";  
  
/*Welche Fehlermeldung soll ausgegeben werden, wenn nicht alle Pflicht-Felder ausgef&uuml;llt sind?*/  
$felderleer = "<p class=titles>Fehler</p><p>Die Nachricht konnte nicht versandt werden, da nicht alle Felder ausgefüllt wurden.</p>";  
  
/*Wie soll der Text aussehen, wenn die E-Mail versendet wurde?*/  
$abgesandt = "<p class=titles>Danke!</p><p>Die Nachricht wurde erfolgreich versand.";  
  
/*Sind alle Felder ausgef&uuml;llt? f&uuml;r jedes Feld das ausgef&uuml;llt sein mu&szlig;, mu&szlig; hier ein entsprechender Eintrag gemacht werden*/  
if ($name == "" || $email =="" || $message =="")  
/*###??<&ucirc;???&rsaquo;?????????&rsaquo;###########################################################################  
  #Bitte ab hier nichts mehr &auml;ndern. Alle Angaben sind im oberen Teil zu machen#  
  ##############################################################################*/  
	{  
	/*nein*/  
	if ($action == 1)  
		header("location:");  
	else echo "$felderleer";  
	}  
		else  
			{  
			/*ja*/  
			/*Ist die E-Mail-Adresse richtig eingegeben?*/  
			if (ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$", $email))  
				{  
				/*E-Mail-Adresse ist richtig*/  
				mail("$webmaster","$betreffwebmaster","$koerperwebmaster\n","FROM: $email\n");  
  
				/*Soll der Absender eine Kopie erhalten?*/  
				if ($kopie == "ja")  
					{  
					mail("$email","$betreffabsender","$koerperabsender\n");  
					if ($action == 1) header("location:".$sUrlMailVersendet);  
					else echo "$abgesandt";  
					}  
				else  
					{  
					if ($action == 1) header("location:".$sUrlMailVersendet);  
					else echo "$abgesandt";  
					}  
				}  
				else  
				{  
					/*nein*/  
					if ($action == 1) header("location:".$sUrlMailFalsch);  
					else echo "$mailfalsch";  
				}  
		}  
		  
$Header = "MIME-Version: 1.0\n";  
$Header .= "Content-type: text/html; charset=iso-8859-1\n";  
$Header .= "From: $name <$email>\n";  
?>