i am using IBSERVER and trying to mail a form to my email address my code is given below
form.html
[code=html]
<html>
<head>
</head>
<body>
<form method="POST" action="mail.ph p">
Name: <input type="TEXT" name="subject">
Email: <input type="TEXT" name="email">
<input type="SUBMIT" name="Submit" value="ok">
</form>
</body>
</html>
[/code]
mail.php
[code=php]
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto="muskhe re@gmail.com";
$mailsubj="Form submission";
$mailhead="$ema il";
reset ($HTTP_POST_VAR S);
$mailbody="Valu es submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VAR S)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$H TTP_POST_VARS[email])) {
mail($mailto, $mailsubj, $mailbody, $mailhead);
}
else
{
echo("Error, no comments were submitted!");
}
?>
[/code]
form.html
[code=html]
<html>
<head>
</head>
<body>
<form method="POST" action="mail.ph p">
Name: <input type="TEXT" name="subject">
Email: <input type="TEXT" name="email">
<input type="SUBMIT" name="Submit" value="ok">
</form>
</body>
</html>
[/code]
mail.php
[code=php]
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto="muskhe re@gmail.com";
$mailsubj="Form submission";
$mailhead="$ema il";
reset ($HTTP_POST_VAR S);
$mailbody="Valu es submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VAR S)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$H TTP_POST_VARS[email])) {
mail($mailto, $mailsubj, $mailbody, $mailhead);
}
else
{
echo("Error, no comments were submitted!");
}
?>
[/code]
Comment