Hallo,
ich möchte eine simple HTML/PHP-Seite erstellen, die mir nach Eingabe einer Email-Adresse eine Email schickt.
Mein Problem ist aber, dass ich gar nicht auf die zweite Seite (wo der Versand der Mail durchgeführt werden soll) weitergeleitet werde, sondern nur die URL verändert wird (z. B. von http://192.168.20.158/InsertMail.php in http://192.168.20.158/InsertMail.php?email=beispiel@test.de), ich aber auf meiner Ursprungsseite verbleibe.
InsertMail.php:
<html>
<head>
<meta charset="utf-8" />
<title>Example page - Test </title>
</head>
<body>
<header>
<hgroup>
<h1> Example page </h1>
<h2> This is my example </h2>
</hgroup>
</header>
<article>
<header>
<h1>Please fill in your Email address and klick "Send Email" to get the email.</h1>
</header>
<section> You will recieve an Email with the Client attached very soon! </section>
<p> </p>
</article>
<form>
<form action="sendemail.php" method="post">
Email address: <input type="email" name="email"> </br>
</br>
<input type="submit" name="submit" value="Send Email">
</form>
</body>
</html>
Und hier die sendemail.php
<html>
<head>
<h1> Result </h1>
</head>
<body>
An email has been sent to <?php echo $_POST["email"];
$providedemail = $_POST["email"];
$subject = "Mail example" ;
$text = "Hi, this is a test. Have a nice day! Your support team";
$fromname = "Support"
mail ($providedemail, $subject, $text, §fromname);
?>
</body>
</html>
Könnt ihr mir helfen?
Liebe Grüße und Danke!
ich möchte eine simple HTML/PHP-Seite erstellen, die mir nach Eingabe einer Email-Adresse eine Email schickt.
Mein Problem ist aber, dass ich gar nicht auf die zweite Seite (wo der Versand der Mail durchgeführt werden soll) weitergeleitet werde, sondern nur die URL verändert wird (z. B. von http://192.168.20.158/InsertMail.php in http://192.168.20.158/InsertMail.php?email=beispiel@test.de), ich aber auf meiner Ursprungsseite verbleibe.
InsertMail.php:
<html>
<head>
<meta charset="utf-8" />
<title>Example page - Test </title>
</head>
<body>
<header>
<hgroup>
<h1> Example page </h1>
<h2> This is my example </h2>
</hgroup>
</header>
<article>
<header>
<h1>Please fill in your Email address and klick "Send Email" to get the email.</h1>
</header>
<section> You will recieve an Email with the Client attached very soon! </section>
<p> </p>
</article>
<form>
<form action="sendemail.php" method="post">
Email address: <input type="email" name="email"> </br>
</br>
<input type="submit" name="submit" value="Send Email">
</form>
</body>
</html>
Und hier die sendemail.php
<html>
<head>
<h1> Result </h1>
</head>
<body>
An email has been sent to <?php echo $_POST["email"];
$providedemail = $_POST["email"];
$subject = "Mail example" ;
$text = "Hi, this is a test. Have a nice day! Your support team";
$fromname = "Support"
mail ($providedemail, $subject, $text, §fromname);
?>
</body>
</html>
Könnt ihr mir helfen?
Liebe Grüße und Danke!