Pino: Formularfeld soll zu Absender werden.

Beitrag lesen

Hallo Tom!

Ich habe im Formular ein Eingabefeld "email". Wenn das Mail ankommt steht als Absender "CGI-Mailer". Wie kann man das Script verändern, um den Absender aus der Forulareingabe zuzuweisen.

Du musst dann natürlich auch die Variable "email" in der Funktion mail mit einbringen.

So sollte es funktionieren:

<?php
  $fmtResponse= implode("", file("response.htt"));
  $fmtMail= implode("", file("mail.htt"));
  foreach($HTTP_POST_VARS as $key=> $val) {
    $fmtResponse= str_replace("<$key>", $val, $fmtResponse);
    $fmtMail= str_replace("<$key>", $val, $fmtMail);
  }
  if ($HTTP_POST_VARS["access"] == "ortelius2003") {
    mail($HTTP_POST_VARS["recipient"],
         $HTTP_POST_VARS["subject"],
  $fmtMail, From: $email\r\nReply-to:$email);

}
  echo $fmtResponse;
?>

Grüße

Pino