php is the one I use on my site for verification and mailshots.
The format is nice and simple. The code below is the code for a basic form mailer, gathering values from $_POST:
PHP Code:
<?php
if($_POST['fromname'] <> NULL && $_POST['fromemail'] <> NULL && $_POST['toemail'] <> NULL && $_POST['subject'] <> NULL && $_POST['msg'] <> NULL) {
$fromemail = stripslashes($_POST['fromemail']);
$toemail = stripslashes($_POST['toemail']);
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= "Content-Transfer-Encoding: 7bit\n";
$headers .= 'From: Fromname <'.$fromemail.'>' . "\n";
$headers .= 'Reply-To: '.$fromemail."\n";
$headers .= 'X-Mailers: PHP /'.phpversion() . "\n";
$subject = $_POST['subject'];
$message = $_POST['msg'];
if (@mail($toemail,stripslashes($subject),stripslashes($message),stripslashes($headers)))
{
echo ('<p>Your message has been sent.</p>');
}
else
{
echo ('<p>Your message has failed to send.</p>');
}
} else {
echo "<p>Please fill out the form completely</p>";
}?>
In addition, you should be able to specify the header "Reply-To", but I have problems with this.
For spoofing, you can use another header "X-Mail-From" or something like that...
Hope this helps.