Jump to content

[SOLVED] Why this is not sending to email.


sandbudd

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.