// EXTENSOMAIL.PHP
//
// This script mails all the submitted form results to the specified
// recipient in $mailto.
// $subject contains the title of the email
// $mailfrom contains the email address that the mail will be sent from
// $mailafterurl contains the URL to redirect the user to afterwards.
// In your mail form, make sure the form elements are named accordingly.
$msg = " Résultats du formulaire d'abonnement en ligne:\n\n";
foreach ( $HTTP_POST_VARS as $key => $value ) {
//print '
'. $key. ' --> '.$value;
switch ( $key ) {
case 'mailto': $to = $value;
break;
case 'mailfrom': $from = $value;
break;
case 'subject': $subj = $value;
break;
case 'mailafterurl': $after = $value;
break;
default: $msg = $msg."\n\n".$key.': '.$value;
}
}
//echo " $subj
$after
$to
$from
$msg ";
$xtra = "From: ".$from."\nX-Mailer: PHP/" . phpversion();
if ( !mail($to,$subj,$msg,$xtra) ) die ( "Could not send mail." );
print '