
Originally Posted by
candleman
Hello,
<?php
// Set Vars
$mother_fn = $_REQUEST ['mother_fn'];
$address = $_REQUEST ['address'];
$city = $_REQUEST ['city'];
$state = $_REQUEST ['state'];
$zip = $_REQUEST ['zip'];
$email = $_REQUEST ['email'];
?>
are you asking request from one page to another? because your are using here $_REQUEST. if you are not accesing data form one page to another you should use $_POST instead of $_REQUEST.
// set the variables
// replace with your email address
$sendto = "";
$subject = "VBS 2009 Registration";
$message = "$mother_fn, $address, $city, $state, $zip, $email";
$extra = 'Cc: ;
// send the email
mail($sendto, $subject, $message, $extra);
$sendto is empty. how can than mail function would know to whether to send the mail. and headers are also missing. bellow is sample mail format which works for me.
PHP Code:
$mailbody = "Dear Sir,";
$mailbody .= "<p>";
$mailbody .= $address;
$mailbody .= $city;
$mailbody .= $state;
$mailbody .= "</p>";
$mailbody .= "<p>Regards.</p>";
$subject = "VBS 2009 Registration";
$fromemail = $fromemail;
$to = $to;
$msg = $mailbody;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:".$fromemail. "\r\n";
$headers;
if(mail($to, $subject, $msg, $headers)){
ob_clean();
// echo "Mail has been sent Successfully.";
echo = "success";
}
else
{
ob_clean();
echo "failed";
}
Bookmarks