All pastes #413102 Raw Edit

Unnamed

public text v1 · immutable
#413102 ·published 2007-03-28 03:20 UTC
rendered paste body
<?php

if ( isset($_POST['submit']) ) {
	
	$to		= $_POST['sendto'];
	$subject	= $_POST['subject'];
	$message	= $_POST['mailmessage'];

	$headers	= 'From: '. $_POST['youremail'] . "\r\n" .
			  'Reply-To: ' . $_POST['youremail'] . "\r\n" .
			  'X-Mailer: PHP/' . phpversion();

echo '<strong>' . ((mail($to, $subject, $message, $headers)) ? 'Sent' : 'Failed Sending') . '</strong>';

}

?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>
<form action="form.php"
method="post">
Send to: <br />
  <input type="text" id="sendto" size="100" />
  <br />
  Your Email:<br />
  <input type="text" id="youremail" size="100" />
  <p>Subject:<br />
  <input type="text" id="subject" size="100" />
<br /> 
    <br />
    Mail Message:
    <br />
    <textarea name="notes" id="mailmessage" rows="20" cols="100"></textarea>
    <br />
    <input type="submit" id="submit" value="Send Mail" />
    </p>
</form>

</body>
</html>
</html>