Page 1 of 1

Form to mail

Posted: Sat Mar 06, 2004 12:07 pm
by twooly
I am doing a simple form to mail script but for some reason I never get the results.

Here is my code

<?
/* this part can either be in the same file as the form or it can be in a different file. If you want this in a different file, make the "action" of the form go to that file */

if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
$body .= "$key: $val\n";
}

mail("myemail@mydomain.com", // to
"Subject Line",
$body);

echo "Thanks for your submission. The results were mailed.";
}

// end form processing
?>

<form
method=post
action=<? echo $PHP_SELF; ?>>
<input type=text name=whatever>
<input type=radio name=this value=radioval>
<select name=another>
<option value=sel1>Select 1
<option value=sel2>Select 2
</select>
<input type=submit name=submit>
</form>

Posted: Sat Mar 06, 2004 12:11 pm
by twooly
Nevermind looks like it is working. Email just running slow