3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by ApocDen
0

Submit the form to a PHP script or the self page itself. And then use $_GET or $_POST to retrieve the values as per your method used in form ( get or post ).

Then you can format the message using the retrieved values.
for emailing simply use mail() function . Its format is mail ( to, subject, message, header )

0

here is something quick and easy i have put together

<html>
<head>
<title>Send an Email</title>
</head>
<body>
<h1>Send an Email
  <br>
  <?php
 if (isset($_POST['Send'])) {
 
  
// Read POST request params into global vars
$to      = $_POST['to'];
$from    = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$headers = "From: $from";

// Send the message
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
  echo "<p>Mail sent! Yay PHP!</p>";
} else {
  echo "<p>Mail could not be sent. Sorry!</p>";
}
}
?>
</h1>
<form id="form1" name="form1" method="post" action="">
<p>To: <input type="text" name="to" value="" /><br />
From: <input type="text" name="from" value="" /><br />
Subject: <input type="text" name="subject" value="" /></p>
<p>Message:<br />
<textarea cols="70" rows="20" name="message"></textarea></p>
<p><input name="Send" type="submit" id="Send" value="Send" /></p>
</form>
</body>
</html>
1

Can use the following header for more supports
$headers = "From: $from\r\nContent-type: text/html";

0

Can use the following header for more supports
$headers = "From: $from\r\nContent-type: text/html";

yea good call

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.