PeterK: PHP Neuling: Mail

Beitrag lesen

Warum geht das net???
<?php
  $Empfaenger_Name = "FamilieKoerner";
  $Empfaenger_EMail = "koerner-famile@t-online.de";
  $Betreff = "Test Mail";
  $Text = "Hallo!\nDas is nur ein kleiner Test!!!\n\nPeter Körner";
  $Absender_Name = "Mr Test";
  $Absender_EMail = "mrtest@xyz.de";

$header  = "From:$Absender_Name<$Absender_EMail>\n";
  $header .= "X-Mailer: PHP/" . phpversion(). "\n";
  $header .= "X-Sender-IP: $REMOTE_ADDR\n";
  $header .= "Content-Type: text/plain";
  $Empfaenger = "$Empfaenger_Name<$Empfaenger_EMail>";

if(mail($Empfaenger, $Betreff, $Text, $header))
  {
    echo "<html><head><title>E-Mail gesendet</title></head><body><h2>E-Mail gesendet</h2><br><table><tr><td><i>Empfänger Name</i></td><td><p><pre>$Empfaenger_Name</pre></p></td></tr><tr><td><i>Empfänger Addresse</i></td><td><p><pre>$Empfaenger_EMail</pre></p></td></tr><tr><td><i>Absender Name</i></td><td><p><pre>$Absender_Name</pre></p></td></tr><tr><td><i>Betreff</i></td><td><p><pre>$Betreff</pre></p></td></tr><tr><td><i>Text</i></td><td><p><pre>$Text</pre></p></td></tr></table></body></html>";
  }
  else
  {
    echo "<html><head><title>Fehler beim versenden der Mail</title></head><body><h1>Fehler beim versenden der Mail</h1></body></html>";
  }
?>