<form method=POST name="email" action="index.php?id=email"> <table> <tr> <td>E-mail:</td><td><input type="text" name="email"></td> </tr> <tr> <td>Subject:</td><td><select name="subject"> <option></option> <option value="Affiliate Application">Affiliate Application</option> -more options removed for space- </select></td> </tr> <tr> <td>Comment:</td><td><textarea name="comment" rows="4"></textarea></td> <tr> <td><input type="submit" name="submit" value="Send"></td> </tr></table> </form> <? $at = '@'; $mail = strpos($_POST['email'], $at); if (isset($_POST['submit'])){ if (!$_POST['email'] || $mail === false){ die ("Please use a valid e-mail address"); } if (!$_POST['subject']){ die ("Please select a subject."); } $to = "email edited"; $message = "from: $from<br> comment:<br> $comment"; $subject = $_POST['subject']; $from = $_POST['email']; $comment = $_POST['comment']; $headers .= "To: $to\r\n"; $headers .= "From: $from\r\n"; mail($to, $subject, $message, $headers); echo "Thank you for your message."; } else { echo "<b>PAGE UNDER CONSTRUCTION, MAIL WON'T ACCTUALLY BE SENT</B>"; } ?>
ok, that's almost the exact code im using as a contact page, i edited out some options and the $to email (to prevent spam)
im running php 4.3.4, apache, and a linux host (all remote, all free)
could anybody tell me why my mail wont send? ive looked at 3 different mail() tutorials, and i even looked at php.net, nothing seams to work
thanks for any help