title: SMTP server response: 451
body: <p>I've build 2 contact forms (quote.php and contact.php), validated with jquery and submitted with to separate ajax_contact.php and ajax_quote.php files. They've both been built on the same template I've used on other sites, but for some reason the ajax_contact.php is returning this error:</p>
  
  <pre><code>Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\5219056\html\ajax_contact.php on line 41
  </code></pre>
  
  <p>I'm getting the autoresponder email, but not the email that actually contains the data submitted in the form.</p>
  
  <p>I'm literally at my wit's end with this. Been trying to fix it all day with "\r\n" and "\n", which I thought would fix it according to the error, but am still in the same boat.</p>
  
  <p>Here is ajax_contact.php:</p>
  
  <pre><code>    &lt;?php
  
          // where is your config file stored?
  include ("ajaxSubmit.php");
  
      // CLIENT INFORMATION
  
  $Firstname =3D $HTTP_POST_VARS['Firstname'];
  $Lastname =3D $HTTP_POST_VARS['Lastname'];
  $email =3D $HTTP_POST_VARS['email'];
  $Business =3D $HTTP_POST_VARS['Business'];
  $Address =3D $HTTP_POST_VARS['Address'];
  $City =3D $HTTP_POST_VARS['City'];
  $State =3D $HTTP_POST_VARS['State'];
  $Zip =3D $HTTP_POST_VARS['Zip'];
  $Phone =3D $HTTP_POST_VARS['Phone'];
  $Fax =3D $HTTP_POST_VARS['Fax'];
  $Comments =3D $HTTP_POST_VARS['Comments'];
  
  
  // MODIFY THE FOLLOWING SECTION
  
  // your name
  $recipientname =3D "Company";
  
  // your email
  $recipientemail =3D "me@email.com";
  
  // subject of the email sent to you
  $subject =3D "Feedback for $recipientname";
  
  // send an autoresponse to the user?
  $autoresponse =3D "yes";
  
  // subject of autoresponse
  $autosubject =3D "Thank you for your mail!";
  
  // autoresponse message
  $automessage =3D "Thanks for the message.";
  
  // thankyou displayed after the user clicks "submit"
  $thanks =3D "Thank you for contacting us. We will get back to you as soon =
  as possible.";
  
  // END OF NECESSARY MODIFICATIONS
  
  // format message
  $message =3D "Online-Form Response for $recipientname:
  &lt;br&gt;
  Firstname: $Firstname
  &lt;br&gt;
  Lastname: $Lastname
  &lt;br&gt;
  Email: $email
  &lt;br&gt;
  Business: $Business
  &lt;br&gt;
  Address: $Address
  &lt;br&gt;
  City: $City
  &lt;br&gt;
  State: $State
  &lt;br&gt;
  Zip: $Zip
  &lt;br&gt;
  Phone: $Phone
  &lt;br&gt;
  Fax: $Fax
  &lt;br&gt;
  Comments: $Comments
  &lt;br&gt;
  ";
  
  // To send HTML mail, the Content-type header must be set
  $headers  =3D "MIME-Version: 1.0" . "\r\n";
  $headers .=3D "Content-type: text/html; charset=3Diso-8859-1" . "\r\n";
  
  // Additional headers
  $headers .=3D "From: Company &lt;info@company.com&gt;" . "=
  \r\n";
  $headers .=3D "Bcc: admin@email.com" . "\r\n";
  
  // send mail and print success message
  mail($recipientemail, $subject, $message, $headers);
  
      echo "&lt;script language=3D\"JavaScript\" type=3D\"text/JavaScript\"&gt; windo=
  w.location.href =3D \"thanks_feedback.php\";&lt;/script&gt;";
  
  ?
  </code></pre>
  
  <p>Here is ajax_quote.php, which is the same thing, just for a different form:</p>
  
  <pre><code>    &lt;?php
          // where is your config file stored?
  include ("ajaxSubmit.php");
  
      // CLIENT INFORMATION
  
  $Contactname = $HTTP_POST_VARS['Contactname'];
  $email = $HTTP_POST_VARS['email'];
  $Contacttitle = $HTTP_POST_VARS['Contacttitle'];
  $Business = $HTTP_POST_VARS['Business'];
  $Address = $HTTP_POST_VARS['Address'];
  $State = $HTTP_POST_VARS['State'];
  $Zip = $HTTP_POST_VARS['Zip'];
  $Phone = $HTTP_POST_VARS['Phone'];
  $Fax = $HTTP_POST_VARS['Fax'];
  $product_desc = $HTTP_POST_VARS['product_desc'];
  $sku = $HTTP_POST_VARS['sku'];
  $annualturns = $HTTP_POST_VARS['annualturns'];
  $seasonal = $HTTP_POST_VARS['seasonal'];
  $minmaxpallet = $HTTP_POST_VARS['minmaxpallet'];
  $avgpalletval = $HTTP_POST_VARS['avgpalletval'];
  $avgpalletwt = $HTTP_POST_VARS['avgpalletwt'];
  $maxpalletht = $HTTP_POST_VARS['maxpalletht'];
  $casesperpallet = $HTTP_POST_VARS['casesperpallet'];
  $unitweight = $HTTP_POST_VARS['unitweight'];
  $reqlotnumctrl = $HTTP_POST_VARS['reqlotnumctrl'];
  $freightclass = $HTTP_POST_VARS['freightclass'];
  $hazardclass = $HTTP_POST_VARS['hazardclass'];
  $barcodes = $HTTP_POST_VARS['barcodes'];
  $avgupsfedex = $HTTP_POST_VARS['avgupsfedex'];
  $avgorderweight = $HTTP_POST_VARS['avgorderweight'];
  $ordersending = $HTTP_POST_VARS['ordersending'];
  $custpickups = $HTTP_POST_VARS['custpickups'];
  $flatfiles = $HTTP_POST_VARS['flatfiles'];
  $shrinkwrap = $HTTP_POST_VARS['shrinkwrap'];
  $repack = $HTTP_POST_VARS['repack'];
  $specialreq = $HTTP_POST_VARS['specialreq'];
  
  $browser = $HTTP_USER_AGENT;
  $ip = $REMOTE_ADDR;
  
  // MODIFY THE FOLLOWING SECTION
  
  // your name
  $recipientname = "Company";
  
  // your email
  $recipientemail = "me@email.com";
  
  // subject of the email sent to you
  $subject = "Quote Request for $recipientname";
  
  // send an autoresponse to the user?
  $autoresponse = "yes";
  
  // subject of autoresponse
  $autosubject = "Thank you for your mail!";
  
  // autoresponse message
  $automessage = "Thanks for the message. We've successfully received your quote request and will get back to you shortly.";
  
  // thankyou displayed after the user clicks "submit"
  $thanks = "Thank you for contacting us. We will get back to you as soon as possible.";
  
  // END OF NECESSARY MODIFICATIONS
  
  // format message
  $message = "Online-Form Response for $recipientname:
  &lt;br&gt;
  Contact Name: $Contactname
  &lt;br&gt;
  Business: $Business
  &lt;br&gt;
  Email: $email
  &lt;br&gt;
  Address: $Address
  &lt;br&gt;
  State: $State
  &lt;br&gt;
  Zip: $Zip
  &lt;br&gt;
  Phone: $Phone
  &lt;br&gt;
  Fax: $Fax
  &lt;br&gt;
  --
  &lt;br&gt;
  Describe your product(s): $product_desc
  &lt;br&gt;
  How many SKU's (items): $sku
  &lt;br&gt;
  How many turns per year?: $annualturns
  &lt;br&gt;
  Are your products seasonal?: $seasonal
  &lt;br&gt;
  Indicate minimum and Maximum pallet levels: $minmaxpallet
  &lt;br&gt;
  Average value per pallet: $avgpalletval
  &lt;br&gt;
  Weight of a typical pallet: $avgpalletwt
  &lt;br&gt;
  Maximum pallet stacking height: $maxpalletht
  &lt;br&gt;
  Cases per pallet? Or average case size?: $casesperpallet
  &lt;br&gt;
  Weight of each unit?: $unitweight
  &lt;br&gt;
  Do you require lot number control?: $reqlotnumctrl
  &lt;br&gt;
  What freight class?: $freightclass
  &lt;br&gt;
  Is the product hazardous? If so, what classifications?: $hazardclass
  &lt;br&gt;
  --
  &lt;br&gt;
  Do you need custom Barcodes made?: $barcodes
  &lt;br&gt;
  What is the average number of orders shipped via UPS/Fedex?: $avgupsfedex
  &lt;br&gt;
  What is the average order size in weight?: $avgorderweight
  &lt;br&gt;
  What is the average number of lines per order?: $avgorderlines
  &lt;br&gt;
  Will your orders be sent via E-mail, FAX, or other?: $ordersending
  &lt;br&gt;
  Will you have customer pick ups, and how often?: $custpickups
  &lt;br&gt;
  Can your company e-mail us flat files?: $flatfiles
  &lt;br&gt;
  Do your orders need to be shrink wrapped?: $shrinkwrap
  &lt;br&gt;
  Do you need repackaging?: $repack
  &lt;br&gt;
  Are there any special requirements that your company may have?: $specialreq
  &lt;br&gt;
  -----------------------------
  &lt;br&gt;
  Browser: $browser
  &lt;br&gt;
  User IP: $ip";
  
  // To send HTML mail, the Content-type header must be set
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
  // Additional headers
  $headers .= 'From: Company &lt;info@company.com&gt;' . "\r\n";
  $headers .= 'Bcc: admin@email.com' . "\r\n";
  
  // send mail and print success message
  mail($recipientemail, $subject, $message, $headers);
  
  if($autoresponse == "yes") {
  $autosubject = stripslashes($autosubject);
  $automessage = stripslashes($automessage);
  mail($email,"$autosubject","$automessage","From: $recipientname &lt;$recipientemail&gt;");
  }
  
      echo "&lt;script language=\"JavaScript\" type=\"text/JavaScript\"&gt; window.location.href = \"thanks_quote.php\";&lt;/script&gt;";
  
  ?
  </code></pre>
  
  <p>Here is ajaxSubmit.php, which doesn't do much:</p>
  
  <pre><code>    &lt;?php
  
  /* VALIDATE HOW YOU NEED TO VALIDATE */
  require_once('recaptchalib.php');
  $privatekey = "******************************";
  $resp = recaptcha_check_answer ($privatekey,
                                  $_SERVER["REMOTE_ADDR"],
                                  $_POST["recaptcha_challenge_field"],
                                  $_POST["recaptcha_response_field"]);
  
  if (!$resp-&gt;is_valid) {
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
         "(reCAPTCHA said: " . $resp-&gt;error . ")");
  }
  
  $isValidate = true;  // RETURN TRUE FROM VALIDATING, NO ERROR DETECTED
  /* RETTURN ARRAY FROM YOUR VALIDATION  */
  
  
  /* THIS NEED TO BE IN YOUR FILE NO MATTERS WHAT */
  if($isValidate == true){
      echo "";
  }else{
      echo '{"jsonValidateReturn":'.json_encode($arrayError).'}';     // RETURN ARRAY WITH ERROR
  }
  ?
  </code></pre>
  
  <p>EDIT: I looked into it a bit more, and it turns out the GoDaddy windows hosting(NOT my choice) doesn't allow the PHP mail function. So I either find a workaround that works(looks like there's a few out there, not many that seem to work), or I get them to switch to Linux hosting(which might fix it).</p>