A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Simple PHP email form

The 'hidden' Return-Path header (not visible Reply-To) will be your name at your domain.

Email form:

<form method="post" action="s.php">
From: <input name="from" type="text" /><br />
To: <input name="to" type="text" /><br />
Subject: <input name="subject" type="text" /><br />
Body:<br />
<textarea name="body" rows="15" cols="40">
</textarea><br />
<input type="submit" value="send"/>
</form>


s.php:

<?php
$to = $_REQUEST['to'] ;
$from = $_REQUEST['from'] ;
$subject = $_REQUEST['subject'] ;
$body = $_REQUEST['body'] ;

$return = mail( $to, $subject, $body, "From: $from\r\nReply-To: $from" );

if ($return == 1) {
print "sent.";
}
else {
print "error.";
}
?>