I have a couple different kinds of forms I have created for a web site. One type of form is for members of the site to invite people to the site and the otehr type of form is a contact form. The first type of form sends an email out to the people who were invited and the other type of form sends an email to the site admin.
I can't seem to get my form mailer to work.
Here is the code I wrote for the form mailer.
if ($whereCaluse == "pursePartyGuests"){
generalQuery(&$connection, "emailConfirmation", NULL, "pursePartyGuests");
$result = $_SESSION['result'];
unset($_SESSION['result']);
$row = @ mysql_fetch_array($result);
// Start by setting up the "to" address
$to = $_POST['firstName'] . " " .
$_POST['lastName'] . " <" .
$_POST['email'] . ">";
// And, last (before we build the email), set up some mail headers
$headers = "From: <" . $row["email"] . ">\r\n";
$headers .= "X-Sender: <" . $row["email"] . ">\r\n";
$headers .= "X-Mailer: PHP\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "Return-Path: <" . $row["email"] . ">\r\n";
// Now, setup the "subject" line
$subject = $row["firstname"] . " " . $row["lastname"] . " has invited you to a purse party!";
$out = "Dear " . $_POST['firstName'] .
" " . $_POST['lastName'] . ",\n" .
"\nYou have been invited to a purse party by " .
$row["firstname"] . " " . $row["lastname"] . ".\n\n";
$out .= "The purse party is on " . $_POST['dateOfPurseParty'] .
" and ends at 12 midnight.\n\n";
$out .= "To go to the purse party go to http://www.cheapchiconline.net " .
"and login using your user name and password. \n\n";
$out .= "If you are an aol user <a href=http://www.cheapchiconline.net>click here</a>\n" .
" to login to the purse party.\n\n";
$out .= "Your User Name is: " . $_POST['email'] . "\n" .
"Your Password is: " . $custID . "\n";
$out .= "Cheap Chic Online is a members only site, so we hope \n" .
"that you can attend the purse party and take advantage \n" .
"of this opportunity to shop for some of the best deals \n" .
"on name brand purses, by designers such as Prada, Fendi Gucci, \n" .
"Tods, Balenciaga, Ferragamo, Marc Jacobs and many more. \n\n";
$out .= "Reguards, \n" .
"Cheap Chic Inc. \n";
}
if ($whereClause == "webForm"){
generalQuery(&$connection, "emailConfirmation", NULL, "webForm");
$result = $_SESSION['result'];
unset($_SESSION['result']);
$row = @ mysql_fetch_array($result);
// Start by setting up the "to" address
$to = " <" . $row['store_email'] . ">";
// And, last (before we build the email), set up some mail headers
$headers = "From: <" . $row["email"] . ">\r\n";
$headers .= "X-Sender: <" . $row["store_email"] . ">\r\n";
$headers .= "X-Mailer: PHP\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "Return-Path: <" . $row["email"] . ">\r\n";
$subject = $_POST['subject'];
$out = $_POST['message'];
}
mail($to, $subject, $out, $headers);
If anyone can help with with gettign this working please let me know.
Greg