rondog Posted December 26, 2007 Share Posted December 26, 2007 Hi, I have a simple email.php file that looks like: <?php mail("myemail","mysubject","mymsg"); ?> That file works just fine. I receive everything. My real file is a little more complicated. I am using header options which may be why I am getting this error. Here is my entire file. It looks like a lot, but its really just a big msg being sent. When I open the file I get 500 Internal server Error. If I comment out the mail functions, the file works. Can any of you see what is wrong with this picture? <?php /* This file submits data to the database including page views, wrong answers, certificates generated, and all of the users information.*/ include 'connect.php'; $done = false; $title = $_POST['theTitle']; $name = $_POST['theName']; $account = $_POST['theCurAct']; $subtitle = $_POST['theSubTitle']; $address1 = $_POST['theAdd1']; $address2 = $_POST['theAdd2']; $city = $_POST['theCity']; $state = $_POST['theState']; $zip = $_POST['theZip']; $phone = $_POST['thePhone']; $email = $_POST['theEmail']; $testNum = $_POST['theTestNumber']; //wrong answer array $wrongAnswers = $_POST['wrongs']; $wrongAnswers_arr = explode(",",$wrongAnswers); $done = true; if($done == true) { if($accountWasNo == true) { echo "&msgText=success"; $headers = "From: [email protected]\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $date = date("m.d.y, g:i a"); $pmsg = "A user has just completed the SynergEyes® PS Practitioner training certification program<br/><br/>"; $pmsg .= "Date/Time: $date<br/>"; $pmsg .= "Title: $title<br/>"; $pmsg .= "Full Name: $name<br/>"; $pmsg .= "Account: $account<br/>"; $pmsg .= "Sub Title: $subtitle<br/>"; $pmsg .= "Address 1: $address1<br/>"; $pmsg .= "Address 2: $address2<br/>"; $pmsg .= "City: $city<br/>"; $pmsg .= "State: $state<br/>"; $pmsg .= "Zip: $zip<br/>"; $pmsg .= "Phone: $phone<br/>"; $pmsg .= "Email: <a href=\"mailto:$email\">$email</a><br/>"; mail("[email protected]","Next Steps to Prescribe SynergEyes® Multifocal",$pmsg,$headers); mail("[email protected]","Next Steps to Prescribe SynergEyes® Multifocal",$pmsg,$headers); $msg = "<b>Congratulations $name</b><br/>"; $msg .= "You have successfully completed the SynergEyes® Multifocal training certification program. If you currently have an active account with SynergEyes, you will now be designated as a \"Certified Multifocal Fitter\" on the doctor locator portion of <a href=\"http://www.synergeyes.com\">www.synergeyes.com</a>.<br/><br/>"; $msg .= "If you do not have an active SynergEyes account, please download and complete the Practice Prescribe It!™ Agreement and fax it back to SynergEyes at (877) 329-2012.<br/><br/>"; $msg .= "<a href=\"http://www.dopmedia.com/hosted/synergeyes/prescribeitagreement.pdf\">Click here to download the SynergEyes® Practice Prescribe It!™ Agreement</a>.<br/><br/>"; $msg .= "SynergEyes® Multifocal Trials Lens Sets are available; although they are not necessary to prescribe the lens. If you would like to have a Trial Lens Set, you have two options for obtaining one: <ul><li>Fit 3 patients in SynergEyes® Multifocal lenses every quarter for 1 year and receive the Trial Lens Set FREE</li><li>Purchase the set for $899 with 30, 60, 90 day payment terms available</li></ul><br/>"; $msg .= "As with all SynergEyes products, the Trial Lens Set is fully warranted for 90 days. To order the Trial Lens Set, please download and complete the Purchase Plan Agreement and fax it back to SynergEyes at (877) 329-2012.<br/><br/>"; $msg .= "<a href=\"http://www.dopmedia.com/hosted/synergeyes/practitionerpurchaseagreement.pdf\">Click here to download the SynergEyes® Purchase Plan Agreement</a>.<br/><br/>"; $msg .= "If you have any questions, please call Customer Care toll free at (877) 733-2012, option 1 or Consultation at (877) 733-2012, option 2.<br/><br/>"; $msg .= "Thank you so much for your time and interest in fitting SynergEyes® Multifocal hybrid contact lens.<br/><br/><b>Welcome!</b><br/><br/>"; mail($email,"Next Steps to Prescribe SynergEyes® Multifocal",$msg,$headers); } elseif($accountWasYes == true) { echo "&msgText=success"; $headers = "From: [email protected]\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $date = date("m.d.y, g:i a"); $pmsg = "A user has just completed the SynergEyes® PS Practitioner training certification program<br/><br/>"; $pmsg .= "Date/Time: $date<br/>"; $pmsg .= "Title: $title<br/>"; $pmsg .= "Full Name: $name<br/>"; $pmsg .= "Account: $account<br/>"; $pmsg .= "Sub Title: $subtitle<br/>"; $pmsg .= "Address 1: $address1<br/>"; $pmsg .= "Address 2: $address2<br/>"; $pmsg .= "City: $city<br/>"; $pmsg .= "State: $state<br/>"; $pmsg .= "Zip: $zip<br/>"; $pmsg .= "Phone: $phone<br/>"; $pmsg .= "Email: <a href=\"mailto:$email\">$email</a><br/>"; mail("[email protected]","Next Steps to Prescribe SynergEyes® Multifocal",$pmsg,$headers); mail("[email protected]","Next Steps to Prescribe SynergEyes® Multifocal",$pmsg,$headers); $msg = "<b>Congratulations $name</b><br/>"; $msg .= "You have successfully completed the SynergEyes® Multifocal training certification program. If you currently have an active account with SynergEyes, you will now be designated as a \"Certified Multifocal Fitter\" on the doctor locator portion of <a href=\"http://www.synergeyes.com\">www.synergeyes.com</a>.<br/><br/>"; $msg .= "If you do not have an active SynergEyes account, please download and complete the Practice Prescribe It!™ Agreement and fax it back to SynergEyes at (877) 329-2012.<br/><br/>"; $msg .= "<a href=\"http://www.dopmedia.com/hosted/synergeyes/prescribeitagreement.pdf\">Click here to download the SynergEyes® Practice Prescribe It!™ Agreement</a>.<br/><br/>"; $msg .= "SynergEyes® Multifocal Trials Lens Sets are available; although they are not necessary to prescribe the lens. If you would like to have a Trial Lens Set, you have two options for obtaining one: <ul><li>Fit 3 patients in SynergEyes® Multifocal lenses every quarter for 1 year and receive the Trial Lens Set FREE</li><li>Purchase the set for $899 with 30, 60, 90 day payment terms available</li></ul><br/>"; $msg .= "As with all SynergEyes products, the Trial Lens Set is fully warranted for 90 days. To order the Trial Lens Set, please download and complete the Purchase Plan Agreement and fax it back to SynergEyes at (877) 329-2012.<br/><br/>"; $msg .= "<a href=\"http://www.dopmedia.com/hosted/synergeyes/practitionerpurchaseagreement.pdf\">Click here to download the SynergEyes® Purchase Plan Agreement</a>.<br/><br/>"; $msg .= "If you have any questions, please call Customer Care toll free at (877) 733-2012, option 1 or Consultation at (877) 733-2012, option 2.<br/><br/>"; $msg .= "Thank you so much for your time and interest in fitting SynergEyes® Multifocal hybrid contact lens.<br/><br/><b>Welcome!</b><br/><br/>"; mail($email,"Next Steps to Prescribe SynergEyes® Multifocal",$msg,$headers); } else { echo "&msgText=Error"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/83282-500-internal-server-error-when-using-mail/ Share on other sites More sharing options...
teng84 Posted December 26, 2007 Share Posted December 26, 2007 http://www.checkupdown.com/status/E500.html have read that^^^ Quote Link to comment https://forums.phpfreaks.com/topic/83282-500-internal-server-error-when-using-mail/#findComment-423724 Share on other sites More sharing options...
rondog Posted December 26, 2007 Author Share Posted December 26, 2007 Ive known this was a server side thing and the tech support at aplus.net is garbage. They keep telling me its something wrong with my file whereas it works perfectly on my personal server. Ahhh so frustrating!! Quote Link to comment https://forums.phpfreaks.com/topic/83282-500-internal-server-error-when-using-mail/#findComment-423750 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.