tyty1993 Posted May 7, 2008 Share Posted May 7, 2008 Can anyone help me out with this? I got all the SENDMAIL_PATH right and all that, it's the php part I think is wrong. Here is the code: <?php $email = $_POST['email']; $problem = $_POST['problem']; //recepients $to = '[email protected]'; //subject $subject = 'New Problem Submitted!'; //message $message = " <br><hr><br> $email has submitted a problem regarding the Hilo High Robotics Website. Here is his/her comply:<br><br> $problem<br><br> This is obviously an automatically generated email and now that you know the problem, you or someone you know must fix it.<br> "; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Webmaster <[email protected]>'. "\r\n"; $headers .= 'From: Webmaster <[email protected]>' ."\r\n"; mail($to, $subject, $message, $headers); include("confirm.php"); ?> Here is the HTML <form action="processform.php" method="POST"> <table cellspacing="5" cellpadding="0"> <tr> <td align="left"> E-Mail </td> <td align="left"> <input type="text" name="email" id="email" size="15"> </td> </tr> <tr> <td align="left"> State the problem: </td> <td align="left"> <textarea name="problem" id="problem" cols="45" rows="5"></textarea> </td> </tr> <tr> <td align="left"> <input type="submit" value="Submit"> </td> </tr> </table> </form> Can anyone help? Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/ Share on other sites More sharing options...
rhodesa Posted May 7, 2008 Share Posted May 7, 2008 But what is the problem? Errors? What is it doing and what are you expecting it to do? Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-535212 Share on other sites More sharing options...
tyty1993 Posted May 8, 2008 Author Share Posted May 8, 2008 Sorry, I forgot to mention. It is not sending the mail, and what I expect was to send it to my email. Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-535730 Share on other sites More sharing options...
conker87 Posted May 8, 2008 Share Posted May 8, 2008 That looks fine to me... I can't see anything wrong with it... Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-535743 Share on other sites More sharing options...
coderb Posted May 8, 2008 Share Posted May 8, 2008 Sorry, I forgot to mention. It is not sending the mail, and what I expect was to send it to my email. have you set up your php.ini with mail server details? Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-535761 Share on other sites More sharing options...
rhodesa Posted May 8, 2008 Share Posted May 8, 2008 There are two common problems with mail scripts. The first was just mentioned... System Configuration: From what you have said so far, I am going to assume this is your personal server (not a hosting service) and you are running Linux. Before you configure PHP to use sendmail, you have to configure sendmail. Basically, you need to have an outgoing SMTP server to relay messages through. Do a google search on how to configure sendmail to use SMTP. To test if sendmail is working, running something like this from the system command line: cat /etc/issue | mail -s "System Info" "[email protected]" Hosting server filters: If you are using a hosting service, they may be filtering the email if it has an 'unapproved' From header. Try using a From email that has the same domain as the webserver. oh...and obviously check your spam filter on your email address....and make sure the TO and FROM are different Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-535803 Share on other sites More sharing options...
tyty1993 Posted May 9, 2008 Author Share Posted May 9, 2008 yes, I'm using a webhosting service, and everything is set correctly. I even checked my spam filter and nothing is there. the TO and FROM are definitely are different. Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-536509 Share on other sites More sharing options...
rhodesa Posted May 9, 2008 Share Posted May 9, 2008 Did you try this: Hosting server filters: If you are using a hosting service, they may be filtering the email if it has an 'unapproved' From header. Try using a From email that has the same domain as the webserver. If that still doesn't work, just give your hosting service a call. Every server configuration is different and they'll be able to help you best on why the code isn't working (cus it should). You pay them for support, don't hesitate to use it! Link to comment https://forums.phpfreaks.com/topic/104509-sending-html-form-mail/#findComment-536665 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.