aebstract Posted March 29, 2007 Share Posted March 29, 2007 Hello, I have a contact page that I am including in to my index page. It should be sending an email upon a completed form. Right now it gives the sent confirmation but isn't sending the email, could someone tell me why? Code: <?php header("Cache-control: private"); if (isset ($_POST['submit'])) { $problem = FALSE; if ($problem == TRUE) { $content .= 'Errors:<br />'; } if (empty ($_POST['firstname'])) { $problem = TRUE; $content = "All fields are required marked with (*) are required"; } if (empty ($_POST['lastname'])) { $problem = TRUE; $content = "All fields are required marked with (*) are required"; } if (empty ($_POST['phone1'])) { $problem = TRUE; $content = "All fields are required marked with (*) are required"; } if (empty ($_POST['email'])) { $problem = TRUE; $content = "All fields are required<br />"; }elseif (!preg_match("/.*@.*..*/", $_POST['email']) OR preg_match("/(<|>)/", $_POST['email'])) { $problem = TRUE; $content .= 'The email address you entered was incorrect<br />'; } if (empty ($_POST['press'])) { $problem = TRUE; $content = "All fields are required marked with (*) are required"; } if (empty ($_POST['addcomment'])) { $problem = TRUE; $content = "All fields are required marked with (*) are required"; } if (!$problem) { $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $phone1 = $_POST['phone1']; $phone2 = $_POST['phone2']; $email = $_POST['email']; $press = $_POST['press']; $addcomment = $_POST['addcomment']; $sendmail = " $firstname $lastname Phone Number 1: $phone1 Phone Number 2: $phone2 E-mail: $email Press/Media Affiliation: $press Additional Comments: $addcomment "; mail ('aebstract@gmail.com', 'Contact Form', $sendmail, 'From: $email'); $form = 'Thank You!'; } else { $form = '<form action="index.php?page=contact" method="post"> <table> <tr> <td align=right>First Name:</td><td width=5></td><td><input type="text" class="txt" name="firstname" maxlength="20" size="20" value="' . $_POST['firstname'] . '" /></td> </tr> <tr> <td align=right>Last Name:</td><td width=5></td><td><input type="text" class="txt" name="lastname" maxlength="20" size="20" value="' . $_POST['lastname'] . '" /></td> </tr> <tr> <td align=right>Phone Number 1:</td><td width=5></td><td><input type="text" class="txt" name="phone1" maxlength="20" size="20" value="' . $_POST['phone1'] . '" /></td> </tr> <tr> <td align=right>Phone Number 2:</td><td width=5></td><td><input type="text" class="txt" name="phone2" maxlength="20" size="20" value="' . $_POST['phone2'] . '" /></td> </tr> <tr> <td align=right>E-mail:</td><td width=5></td><td><input type="text" class="txt" name="email" maxlength="20" size="20" value="' . $_POST['email'] . '" /></td> </tr> <tr> <td align=right>Press/Media Affiliation:</td><td width=5></td><td><input type="text" class="txt" name="press" maxlength="20" size="20" value="' . $_POST['press'] . '" /></td> </tr> <tr> <td align=right>Additional Comments:</td><td width=5></td><td><textarea name="addcomment" cols="36" rows="4" class="txt"></textarea></td> </tr> <tr> <td align=right></td><td width=5></td><td align=right><input type="submit" name="submit" value="Send" class="formsubmit" /></td> </tr> </table> </form>'; } } else { $form = '<form action="index.php?page=contact" method="post"> <table> <tr> <td align=right>First Name:</td><td width=5></td><td><input type="text" class="txt" name="firstname" maxlength="20" size="20" value="' . $_POST['firstname'] . '" /></td> </tr> <tr> <td align=right>Last Name:</td><td width=5></td><td><input type="text" class="txt" name="lastname" maxlength="20" size="20" value="' . $_POST['lastname'] . '" /></td> </tr> <tr> <td align=right>Phone Number 1:</td><td width=5></td><td><input type="text" class="txt" name="phone1" maxlength="20" size="20" value="' . $_POST['phone1'] . '" /></td> </tr> <tr> <td align=right>Phone Number 2:</td><td width=5></td><td><input type="text" class="txt" name="phone2" maxlength="20" size="20" value="' . $_POST['phone2'] . '" /></td> </tr> <tr> <td align=right>E-mail:</td><td width=5></td><td><input type="text" class="txt" name="email" maxlength="20" size="20" value="' . $_POST['email'] . '" /></td> </tr> <tr> <td align=right>Press/Media Affiliation:</td><td width=5></td><td><input type="text" class="txt" name="press" maxlength="20" size="20" value="' . $_POST['press'] . '" /></td> </tr> <tr> <td align=right>Additional Comments:</td><td width=5></td><td><textarea name="addcomment" cols="36" rows="4" class="txt"></textarea></td> </tr> <tr> <td align=right></td><td width=5></td><td align=right><input type="submit" name="submit" value="Send" class="formsubmit" /></td> </tr> </table> </form>'; } echo ' <center> <strong>*ROADTRIP 2007*</strong> <br /><br /> <em>Press Submission Form</em> </center> <br /><br /> PMG-Rubicon<br /> 5678 Kingsport Dr. NE<br /> Atlanta, GA 30342<br /> 310.975.4900 404.252.5689<br /> <a href=mailto:info@rubicontalent.com>info@rubicontalent.com</a> <br /><br /> <center> LOS ANGELES . ATLANTA . NEW YORK . NASHVILLE <br /> ------------------------------------------------------------------------ </center> <br /><br />'; echo "$content"; echo "$form"; echo '<br /><br /> <strong><center>MANAGEMENT STAFF DIRECTORY</center></strong> <br /><br /> <strong>PMG- RUBICON RECORDS GROUP, LLC</strong> <br /> Steven Paul Perry, Managing Partner/FOUNDER <br /> P.O. Box 46488 <br /> Los Angeles, California 90046 <br /> Direct Dial: 310.614.2947 <br /> WEB MAIL: steven@rubicontalent.com <br /> WEBSITE www.rubicontalent.com <br /> MY SPACE: http://www.myspace.com/talentgroup <br /><br /> <strong>RUBICON TALENT DEVELOPMENT GROUP</strong> <br /> Jeremy R. Harvin, Managing Partner, Product Development <br /> 5678 Kingsport Drive, NE <br /> Atlanta, Georgia 30342 <br /> Telephone: 404.252.5689 <br /> WEB MAIL: jhrubicon@yahoo.com <br /> MY SPACE: http://www.myspace.com/talentgroup <br /><br /> <strong>PERRY MUSIC GROUP OF FAMILIES, LLC</strong> <br /> Chip O’ Kelley, Manager, CORPORATE OPERATIONS <br /> P.O. Box 46488 <br /> Los Angeles, CA 90046 <br /> Direct Dial: 310-614-2947 <br /> WEB MAIL: info@rubicontalent.com <br /> ONLINE STORE: www.shoprubicontalent.com (shop.rubicontalent.com) <br /> MY SPACE: http://www.myspace.com/stevenpaulisback <br /> ATLANTA 404.252.5689 <br /><br /> <strong>Managing Partner, Marketing </strong> <br /> Nathan Padgett, Web Services Manager <br /><br /> <strong>Business Affairs, Support</strong> <br /> Jeff Webster, Office Manager <br /> LOS ANGELES 310.975.4900 <br /><br /> <strong>Managing Partner, Talent Development</strong> <br /> Edward McMurray, Artistic Director <br /><br /> <strong>Managing Partner, Finance</strong> <br /> Rolando Lira, Manager, Business Affairs <br /><br /><br /> <center> <sub>*PLEASE NOTE:<br /> (All unsolicited materials submitted for consideration will NOT be returned) <br /> (In order to ensure your materials are returned to you -- a self-addressed, prepaid shipping envelope must be enclosed) </center> </sub> '; ?> Quote Link to comment https://forums.phpfreaks.com/topic/44813-solved-email-not-sending/ Share on other sites More sharing options...
aebstract Posted March 29, 2007 Author Share Posted March 29, 2007 It took like 15 minutes for the email to send, was a slow spot in the server or something. Sorry! Quote Link to comment https://forums.phpfreaks.com/topic/44813-solved-email-not-sending/#findComment-217617 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.