sandbudd Posted November 7, 2008 Share Posted November 7, 2008 Hey guys have a question... Here is the form and the thankyou.php. I am not sure why this is not sending to my email address. I changed the email address but had the correct one when on line. This should be pretty easy but I am having troubles and thanks in advance. Im not getting any errors. <form id="form1" name="form1" method="post" action="thankyou.php"> <table class="contact" width="100%" border="0"> <tr> <td align="left" valign="top"> </td> <td colspan="2"> </td> </tr> <tr> <td width="23%" align="left" valign="top"><span class="style31">Name:</span></td> <td colspan="2"><label> <input name="name" type="text" id="name" size="50" /> </label></td> </tr> <tr> <td>Email:</td> <td colspan="2"><label> <input name="email" type="text" id="email" size="50" /> </label></td> </tr> <tr> <td>Comments:</td> <td colspan="2" rowspan="3" align="left" valign="top"><label> <textarea name="comments" id="comments" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td colspan="2"> </td> </tr> <tr> <td> </td> <td width="29%"><label> <div align="center"> <input type="reset" name="reset" id="reset" value="Reset" /> </div> </label></td> <td width="48%"><label> <div align="center"> <input type="submit" name="submit" id="submit" value="Submit" /> </div> </label></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </form> thankyou.php <?php ERROR_REPORTING(E_ALL); //sends email via php to the following address $mailuser = "myemail"; //echo 'default chosen address: '.$mailuser; $header = "Return-Path: ".$email."\r\n"; $header .= "From: <".$email.">\r\n"; $header .= "Content-Type: text/html;"; $mail_body = ' Name: '. $_POST[name] . '<br> email: '. $_POST[email] . '<br> comments: '. $_POST[comments] . '<br> echo 'Thank you for contacting Sandbudd Custom Designs. We will respond as soon as possible.'; ?> Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/ Share on other sites More sharing options...
dezkit Posted November 7, 2008 Share Posted November 7, 2008 wait Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684278 Share on other sites More sharing options...
sandbudd Posted November 7, 2008 Author Share Posted November 7, 2008 ? Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684282 Share on other sites More sharing options...
sandbudd Posted November 7, 2008 Author Share Posted November 7, 2008 It is also not displaying the thank you message Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684284 Share on other sites More sharing options...
dezkit Posted November 7, 2008 Share Posted November 7, 2008 Use this for your thankyou.php: <?php ERROR_REPORTING(E_ALL); $mailuser = "myemail"; //echo 'default chosen address: '.$mailuser; $header = "Return-Path: ".$email."\r\n"; $header .= "From: <".$email.">\r\n"; $header .= "Content-Type: text/html;"; $mail_body = "Name:". $_POST['name'] . "<br> email: ". $_POST['email'] . "<br> comments: ". $_POST['comments'] . "<br>"; echo "Thank you for contacting Sandbudd Custom Designs. We will respond as soon as possible."; ?> Also: http://us3.php.net/function.mail Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684286 Share on other sites More sharing options...
sandbudd Posted November 7, 2008 Author Share Posted November 7, 2008 it displays the thank you message but the email is not received. Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684292 Share on other sites More sharing options...
dezkit Posted November 7, 2008 Share Posted November 7, 2008 http://w3schools.com/php/php_mail.asp Link to comment https://forums.phpfreaks.com/topic/131732-solved-why-this-is-not-sending-to-email/#findComment-684300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.