kobryan Posted November 15, 2013 Share Posted November 15, 2013 I have used this for a while until recently i added the second email address to the form. For some reason it is not sending the emails after the addition. I wanted to make sure this is not a problem with my coding before i went to my server company and checked with them. thanks for any help. <?php $form = "<form action='contact.php' method='post'> <table> <tr> <td></td> <td><font color='red'>*</font> are required</td> </tr> <tr> <td>Full Name:</td> <td><input type='text' name='fullname' class='textbox' size='56px'><font color='red'>*</font></td> </tr> <tr> <td>Phone:</td> <td><input type='text' name='phone' class='textbox' size='56px'><font color='red'>*</font></td> </tr> <tr> <td>City:</td> <td><input type='text' name='city' class='textbox' size='56px'><font color='red'>*</font></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email' class='textbox' size='56px'><font color='red'>*</font></td> </tr> <tr> <td>Questions/Comments:</td> <td><textarea type='text' name='comment' class='textbox' rows='7' cols='43'></textarea><font color='red'>*</font></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' class='button' value='Submit'></td> </tr> </table> </form>"; if ($_POST['submitbtn']){ $fullname = $_POST['fullname']; $email = $_POST['email']; $comment = $_POST['comment']; $phone = $_POST['phone']; $city = $_POST['city']; if ($fullname && $phone && city && $email && $comment){ if (strstr($email, "@") && strstr($email, ".") && (strlen($email) >= 6)){ mysql_query("INSERT INTO contact VALUES ('', '$fullname', '$phone', '$city', '$email', '$comment', NOW())"); $webmaster = "xxx@xxx.com, xxx@xxx.com"; $headers = "From: $fullname<$email>"; $subject = "Contact Us Form from $fullname"; $message = "$fullname\r\n$phone\r\n$city\r\n$email\r\n$comment"; mail ($webmaster, $subject, $message, $headers); echo "Your message has been sent. $form"; } else echo"Please enter a valid email address. $form"; } else echo "You did not enter all required information. $form"; } else echo "$form"; ?> Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted November 15, 2013 Share Posted November 15, 2013 what second email address in the form? i only see one. Quote Link to comment Share on other sites More sharing options...
kobryan Posted November 15, 2013 Author Share Posted November 15, 2013 what second email address in the form? i only see one. $webmaster = "#1 xxx@xxx.com, #2 xxx@xxx.com"; Im sorry i must of used incorrect terms. The submission email that is going to me and my partner when i added my partners email address in the $webmaster section seemed to stop sending them all together. My DB still gets every submission. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted November 15, 2013 Share Posted November 15, 2013 are the domains, the @xxx.com, in both of the email addresses the same? anyway, you are probably triggering some relaying restrictions on your mail server. what if any php errors do you get when you add the following two lines of php code into your program - ini_set("display_errors", "1"); error_reporting(-1); Quote Link to comment Share on other sites More sharing options...
kobryan Posted November 16, 2013 Author Share Posted November 16, 2013 are the domains, the @xxx.com, in both of the email addresses the same? anyway, you are probably triggering some relaying restrictions on your mail server. what if any php errors do you get when you add the following two lines of php code into your program - ini_set("display_errors", "1"); error_reporting(-1); They are the same domain name in both email addresses. I added the code but no errors appeared and the code seemed to start working again does that mean it was server side or is what you had me add what fixed it? I'm getting no PHP errors in my error log or on the page with this code since it seems like this is supposed to show the errors on the screen. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.