By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,348 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,348 IT Pros & Developers. It's quick & easy.

php completing action but not emailing.

P: 3
I have been using this script successfully for about a month now, However i changed a bunch of inputs and now the php is running through to the "email has been sent " box but an email is never recieved by any email i put in there. here is the html code
Expand|Select|Wrap|Line Numbers
  1. <DIV STYLE = "POSITION: absolute; TOP: 410px; right: 50px">
  2. <a href="http://www.Dometic.com"><img src="Http://www.bayourvservice.com/photos/dometic.jpg" width="100" height="100" /></a></div>
  3.  
  4. <CENTER><form id="contact-form" name="contact-form" action="form.php" method="post" "
  5.     onsubmit="return validateForm()">
  6. <input id="name" type="name" name="name" value="Work Order #"  
  7.      onfocus="if (this.value=='Work Order #') this.value='';" onblur="if (this.value=='') 
  8.      this.value='Work Order #';"/><br />
  9. <input id="job1" type= text" name="job1" maxlength="4" size="2" value="Job#" onfocus="if     
  10.     (this.value=='Job#') this.value='';" onblur="if (this.value=='') 
  11.     this.value='Job#';" /><input id="pd1" type="text" name="pd1" value="Part Description"  onfocus="if 
  12.     (this.value=='Part Description') this.value='';" onblur="if (this.value=='')   
  13.      this.value='Part Description';" /><input id="qt1" maxlength="4" size="2" type="name" name="qt1" value="Qty:"  
  14.      onfocus="if (this.value=='Qty:') this.value='';" onblur="if (this.value=='Qty:') 
  15.      this.value='Qty:';"/><br />
  16. <input id="job2" type= text" name="job2" maxlength="4" size="2" value="Job#" onfocus="if     
  17.     (this.value=='Job#') this.value='';" onblur="if (this.value=='') 
  18.     this.value='Job#';" /><input id="pd2" type="text" name="pd2" value="Part Description"  onfocus="if 
  19.     (this.value=='Part Description') this.value='';" onblur="if (this.value=='')   
  20.      this.value='Part Description';" /><input id="qt2" maxlength="4" size="2" type="name" name="qt2" value="Qty:"  
  21.      onfocus="if (this.value=='Qty:') this.value='';" onblur="if (this.value=='Qty:') 
  22.      this.value='Qty:';"/><br />
  23. <input id="job3" type= text" name="job3" maxlength="4" size="2" value="Job#" onfocus="if     
  24.     (this.value=='Job#') this.value='';" onblur="if (this.value=='') 
  25.     this.value='Job#';" /><input id="pd3" type="text" name="pd3" value="Part Description"  onfocus="if 
  26.     (this.value=='Part Description') this.value='';" onblur="if (this.value=='')   
  27.      this.value='Part Description';" /><input id="qt3" maxlength="4" size="2" type="name" name="qt3" value="Qty:"  
  28.      onfocus="if (this.value=='Qty:') this.value='';" onblur="if (this.value=='Qty:') 
  29.      this.value='Qty:';"/><br />
  30. <input id="job4" type= text" name="job4" maxlength="4" size="2" value="Job#" onfocus="if     
  31.     (this.value=='Job#') this.value='';" onblur="if (this.value=='') 
  32.     this.value='Job#';" /><input id="pd4" type="text" name="pd4" value="Part Description"  onfocus="if 
  33.     (this.value=='Part Description') this.value='';" onblur="if (this.value=='')   
  34.      this.value='Part Description';" /><input id="qt4" maxlength="4" size="2" type="name" name="qt4" value="Qty:"  
  35.      onfocus="if (this.value=='Qty:') this.value='';" onblur="if (this.value=='Qty:') 
  36.      this.value='Qty:';"/><br />
  37. <input id="job5" type= text" name="job5" maxlength="4" size="2" value="Job#" onfocus="if     
  38.     (this.value=='Job#') this.value='';" onblur="if (this.value=='') 
  39.     this.value='Job#';" /><input id="pd5" type="text" name="pd5" value="Part Description"  onfocus="if 
  40.     (this.value=='Part Description') this.value='';" onblur="if (this.value=='')   
  41.      this.value='Part Description';" /><input id="qt5" maxlength="4" size="2" type="name" name="qt5" value="Qty:"  
  42.      onfocus="if (this.value=='Qty:') this.value='';" onblur="if (this.value=='Qty:') 
  43.      this.value='Qty:';"/><br />
  44.  
  45. <select name='servicewriter'>
  46.   <option value="none">Service Writer</option>
  47.   <option value="Rvwarranty2@BayouOutdoor.com">Laura Ryan</option>
  48.   <option value="Rvwarranty@BayouOutdoor.com">Gail Warner</option>
  49.   <option value="C_Brazzel@yahoo.com">Cody Brazzel</option>
  50.   <option value="Rvwarranty@BayouOutdoor.com">Robert Moore</option>
  51.   <option value="RVChassis@BayouOutdoor.com">Charles Gleason</option>
  52. </select>
  53. <br>
  54. <input type="checkbox" name="request" value="Quote" /> Price and Availability<br />
  55. <input type="checkbox" name="request" value="Order" /> Order Parts  
  56. <br>
  57.  
  58.  
  59.  
  60. <br>
  61. <center><input type="submit" name="send" value="SEND" /><input type="reset" value="Reset" /></center>
  62. </form>
  63.  
and here is the php

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.         $subject = $_POST['name'];
  4.         $name =  $_POST['name'];
  5.         $job1 = $_POST['job1'];
  6.         $pd1 = $_POST['pd1'];
  7.         $qt1 = $_POST['qt1'];
  8.         $job2 = $_POST['job2'];
  9.         $pd2 = $_POST['pd2'];
  10.         $qt2 = $_POST['qt2'];
  11.         $job3 = $_POST['job3'];
  12.         $pd3 = $_POST['pd3'];
  13.         $qt3 = $_POST['qt3'];
  14.         $job4 = $_POST['job4'];
  15.         $pd4 = $_POST['pd4'];
  16.         $qt4 = $_POST['qt4'];
  17.         $job5 = $_POST['job5'];
  18.         $pd5 = $_POST['pd5'];
  19.         $qt5 = $_POST['qt5'];
  20.         $request = $_POST['request'];
  21.         $servicewriter = $_POST['servicewriter'];
  22.  
  23.  
  24.         $list=array($name, $job1, $pd1, $qt1, $job2, $pd2, $qt2, $job3, $pd3, $qt3, $job4, $pd4, $qt4, $job5, $pd5, $qt5, $request, $servicewriter );
  25.         $strTo = trim($_POST["servicewriter"]) . "\r\n" . 'charles.gleason@aol.com' . "\r\n" ;
  26.         $strSubject = "Technician:  " . trim($_POST["name"]);
  27.         $strFrom = "Work Order:  " . trim($_POST["name"]);
  28.         $str_content = "Work Order:". trim($_POST["name"]) . "\r\n" . "Job#: " . trim($_POST["job1"]) . trim($_POST["pd1"]) . trim($_POST["qt1"]) . "\r\n" . "Job#: " . trim($_POST["job2"]) . trim($_POST["pd2"]) . trim($_POST["qt2"]) . "Job#: " . trim($_POST["job3"]) . trim($_POST["pd3"]) . trim($_POST["qt3"]) . "Job#: " . trim($_POST["job4"]) . trim($_POST["pd4"]) . trim($_POST["qt4"]) . "Job#: " . trim($_POST["job5"]) . trim($_POST["pd5"]) . trim($_POST["qt5"]) . "\r\n" . "Request Type: " .      trim($_POST["request"]) . "\r\n" ;
  29.                 mail($strTo,$strFrom,$strSubject,$str_content); 
  30.  
  31.             echo ("<SCRIPT LANGUAGE='JavaScript'></SCRIPT>");
  32.              echo "<script>alert(' YOUR EMAIL HAS BEEN SENT. ')</script>";
  33.               echo '<script>reset();</script>';
  34.               echo "<script>window.history.go(-1)</script>";        
  35.  
  36.   ?>
  37.  
  38.  
Please help.
Apr 30 '12 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
did you check whether mail() returned true for successfully passing the mail to sendmail/SMTP?

PS. your script would claim to have a mail sent even if there were no email code at all.
May 3 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.