mail form not working?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkfreaks
Forum Commoner
Posts: 59
Joined: Sat Sep 09, 2006 3:59 pm

mail form not working?

Post by darkfreaks »

ok so my form works but it doesnt send an email to me?

the code is:

Code: Select all

//mail
$to = "mowtripleh@hotmail.com";
$subject = "Order from " . $name;
$email = $_POST[email];
$headers = "Content-Type: text/html";
$message = "<b><font face=\"arial\" size=\"3\" color=\"pink\">" . $name . " has ordered the following items:</font>\n
\n
<table>\n
<tr><td>Necklace:</td><td>Length</td><td>Bead Size</td><td>Bead Type</td><td>Quantity</td><td>Subtotal:</td></tr>\n
<tr><td>Necklace of the Night Sky:</td><td> " . $NNSL . " </td><td> " . $NNSBS . " </td><td> " . $NNSBT . " </td><td> " . $NNSQTY . " </td><td>\$" . $NNPRICE . "</td></tr>\n
<tr><td>Chainmaile Beaded FancyNecklace:</td><td> " . $CBFNL . " </td><td> " . $CBFNBS . " </td><td> " . $CBFNBT . " </td><td>" . $CBFNQTY . "</td><td>\$" . $CBFPRICE . "</td></tr>\n
<tr><td>Antique Key Necklace:</td><td> " . $AKNL . " </td><td> " . $AKNBS . " </td><td> " . $AKNBT . " </td><td>" . $AKNQTY . "</td><td>\$" . $AKNPRICE . "</td></tr>\n
<tr><td>Chainmaile Fancy Necklace:</td><td> " . $CFNL . " </td><td> " . $CFNBS . " </td><td> " . $CFNBT . " </td><td>" . $CFNQTY . "</td><td>\$" . $CFNPRICE . "</td></tr>\n
<tr><td>Chainmaile V Necklace:</td><td> " . $CVNL . " </td><td> " . $CVNBS . " </td><td> " . $CVNBT . " </td><td>" . $CVNQTY . "</td><td>\$" . $CVNPRICE . "</td></tr>\n
<tr><td colspan=\"6\"><hr></td></tr>
<tr><td>Total:</td><td></td><td></td><td></td><td></td><td>\$" . $totalamount . "</td></tr>\n
</table>";
if (mail($to,$subject,"From: $email\n",$message .$headers)) {echo 'Your order has been sent to ', $to, ' from ', $email, ' with the subject ', $subject, ' and the following message:<br>', $message, '.';} else {echo "Something went wrong. Please send an email directly to admin@tatoos-n-piercings.com";}
}
?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Building the proper headers and escaping spam filters can often be tricky with the mail().. if you want my advise I would suggest Swift Mailer (which happens to have a home on our forum, if you'll scroll down to the bottom of our forum index) :wink:
darkfreaks
Forum Commoner
Posts: 59
Joined: Sat Sep 09, 2006 3:59 pm

Post by darkfreaks »

lock this topic it works its just being really slow. the mail server that is
Post Reply