1 Reply Latest reply: Apr 30, 2013 4:55 PM by Nancy O. RSS

    PHP not emailing

    hj18345 Community Member

       

      I have put together a PHP script. When i click on submit my thank you page appears, but i haven't received the email yet. Here is my code... any ideas what i did wrong?

       

       

       

       

       

      <?php

      /* Subject and Email Variables */

       $emailSubject = 'Request A Quote!';

       $webMaster = 'Heather@peaklaboratories.com' ;
       
      /* Gathering Data Variables */

       $first_nameField= $_POST['first_name'];
       $last_nameField = $_POST['last_name'];
       $company_nameField = $_POST['company_name'];
       $company_addressField = $_POST['company_address'];
       $company_cityField = $_POST['company_city'];
       $company_state_provinceField = $_POST['company_state_province'];
       $company_countryField = $_POST['company_country'];
       $company_zipField = $_POST['company_zip'];
       $email_Field = $_POST['email'];
       $phone_numberField = $_POST['phone_number'];
       $install_locationField = $_POST['install_location'];
       $install_addressField = $_POST['install_address'];
       $install_cityField = $_POST['install_city'];
       $install_stateField = $_POST['install_state'];
       $install_zipField = $_POST['install_zip'];
       $install_countryField = $_POST['install_country'];
       $applicationField = $_POST['application'];
       
       $body = <<<EOD
      <br><hr><br>
      First_name: $first_name <br>
      Last_name: $last_name <br>
      Company Name: $company_name <br>
      Company Address: $company_address <br>
      Company City: $company_city <br>
      Company State: $company_state_province <br>
      Company Country: $company_country <br>
      Company Zip: $company_zip <br>
      Email: $email <br>
      Phone Number: $phone_number <br>
      Install Company: $install_location <br>
      Install Address: $install_address <br>
      Install City: $install_city <br>
      Install State: $install_state <br>
      Install Country: $install_country <br>
      Application: $application <br>
      EOD;


       $headers = "From:  $email\r\n";
       $headers .= "Content-type: text/html\r\n";
       $success = mail($webMaster, $emailSubject, $body, $headers);
       
      /* Results rendered as HTML */


       $theResults = <<<EOD

      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      <html xmlns="[http://www.w3.org/1999/xhtml | http://www.w3.org/1999/xhtml]" >
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <meta name="description" content="Peak Laboratories is the world leader in the design and manufacture of specialty gas chromatography systems. Our proven Mercuric Oxide and Flame Ionization (FID) detector technologies are used by many industries throughout the world." />
      <meta name="keywords" content="Peak Performer 1 RCP, Peak Performer 1 FID, Peak Performer 2 RCP, Peak Performer 1 PDD, Flame Ionization Detector, Reducing Compound Photometer, Pulse Discharge Detector, gas chromatography system" />
      <title>Peak Laboratories | Contact us</title>


      <link rel="stylesheet" type="text/css" href="/css/index.css" media="all" />


      &lt;script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"&gt;&lt;/script&gt;

          <link rel="stylesheet" href="/css/general.css" type="text/css" media="screen" />
          <script src="/css/popup.js" type="text/javascript"></script>

      <script type="text/javascript">

        var _gaq = _gaq || [];

        _gaq.push();
        gaq.push();</p><p>  (function() {<br>    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;<br>    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';<br>    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);<br>  })();</p><p>&lt;/script&gt;<br>&lt;/head&gt;</p><p>&lt;body&gt;</p><p><br>&lt;div id="container"&gt;<br>&lt;div id="main"&gt;</p><p><br>&lt;div id="topband"&gt;&lt;/div&gt;<br> &lt;br class="clearfloat" /&gt;<br> &lt;div id="topbandcolors"&gt;&lt;/div&gt;
       <br class="clearfloat" />
       <div id="logo-tagline_bg"></div>
       <a href="/">
        <img src="/images/peak_labs_logo.gif" id="peak_labs_logo"  alt="Peak Laboratories Logo" />
         </a>
       <div id="topgreen_band"></div>
       <br class="clearfloat" />
       <div id="left_column">
         
      &lt;!-- NAV STARTS HERE &gt;<br> &lt;div id="leftnav_region"&gt;<br> <br>    &lt;ul id="flyout"&gt;<br>        &lt;li&gt;&lt;a href="/"&gt;&lt;b&gt;Home&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>        &lt;li&gt;&lt;a href="/about_us/"&gt;&lt;b&gt;About Us&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>     &lt;li&gt;&lt;a href="/products/"&gt;&lt;b&gt;Products&lt;/b&gt;&lt;![if gte IE 7]&gt;&lt;!&gt;&lt;/a&gt;&lt;!&lt;![endif]&gt;<br>        &lt;![if lte IE 6]&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]&gt;<br>            &lt;ul&gt;<br>                &lt;li&gt;&lt;a href="/products/performer_1tcd.html"&gt;&lt;b&gt;Peak Performer 1 TCD&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>                &lt;li&gt;&lt;a href="/products/performer_1fid.html"&gt;&lt;b&gt;Peak Performer 1 FID&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>                &lt;li&gt;&lt;a href="/products/performer_1rcp.html"&gt;&lt;b&gt;Peak Performer 1 RCP&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>                &lt;li&gt;&lt;a href="/products/performer_1pdd.html"&gt;&lt;b&gt;Peak Performer 1 PDD&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>                &lt;li class="last"&gt;&lt;a href="/products/performer_2rcp.html"&gt;&lt;b&gt;Peak Performer 2 RCP&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>            &lt;/ul&gt;<br>        &lt;![if lte IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;&lt;a href="/services/"&gt;&lt;b&gt;Services&lt;/b&gt;&lt;/a&gt;&lt;/li&gt; <br>        &lt;li&gt;&lt;a href="/resources/"&gt;&lt;b&gt;Resource Library&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>        &lt;li&gt;&lt;a class="current" href="/contact_us/"&gt;&lt;b&gt;Contact Us&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;<br>    &lt;/ul&gt;</p><p> &lt;/div&gt;<br>&lt;! NAV ENDS HERE &gt;<br>   <br>&lt;! LEFT ADS STARTS HERE &gt;        <br>    &lt;div id="homepage_ads"&gt;<br>      &lt;p class="ad_title"&gt;Phone contact&lt;/p&gt;<br>        &lt;img src="/images/horizontal_line.gif" width="166" height="6"&gt;&lt;br /&gt;<br>         &lt;p class="ad_copy"&gt;&lt;span class="bodycopy"&gt;Please contact Peak Laboratories at &lt;strong&gt;650-691-1267&lt;/strong&gt;&lt;/span&gt;.&lt;/p&gt;<br>     &lt;/div&gt;<br>&lt;! LEFT ADS STARTS HERE &gt;        </p><p>&lt;/div&gt;<br> &lt;div id="colwrap1"&gt;<br>  &lt;div id="subpage_image_banner"&gt;<br>&lt;! ANIMATION STARTS HERE &gt;<br>     &lt;img src="/images/subpage_image_contact_us.jpg" width="625" height="169" alt="Peak Performer Gas Analysis" /&gt;</p><p>&lt;! ANIMATION ENDS HERE &gt;<br>  &lt;/div&gt;<br>  &lt;br class="clearfloat" /&gt;<br>  &lt;div id="breadcrumbtrail"&gt;<br>&lt;! BREADCRUMB STARTS HERE &gt;        <br>        &lt;p class="breadcrumb_text"&gt;&lt;a href="/"&gt;home&lt;/a&gt;&amp;nbsp; // &amp;nbsp;&lt;strong&gt;contact us&lt;/strong&gt;&lt;/p&gt;<br>&lt;! BREADCRUMB ENDS HERE &gt;      <br>  &lt;/div&gt;<br>  &lt;br class="clearfloat" /&gt;<br>  &lt;div id="content_area"&gt;<br>        <br>&lt;! CONTENT STARTS HERE &gt;     </p><p>  &lt;H1&gt;THANK YOU&lt;/H1&gt;<br>        <br>  &lt;p class="introcopy"&gt; </p><p><br>FORM SUBMISSION CONFIRMATION. Thank you for your response. We will review the information you submitted and contact you shortly.&lt;br /&gt;&lt;br /&gt;</p><p>-Peak Laboratories&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br>        &lt;p class="bodycopy"&gt;&amp;nbsp;&lt;/p&gt;<br>        &lt;p class="bodycopy"&gt;&lt;br /&gt;<br>          &lt;! CONTENT ENDS HERE &gt;<br>  <br>        <br>  &lt;/div&gt;<br>  &lt;br class="clearfloat" /&gt;&lt;/div&gt;<br> &lt;div id="green_footer"&gt;&lt;/div&gt;<br> &lt;br class="clearfloat" /&gt;<br> &lt;div id="bottom_band_colors"&gt;&lt;/div&gt;<br> &lt;br class="clearfloat" /&gt;<br> &lt;div id="grey_footer"&gt;<br>&lt;! FOOTER STARTS HERE &gt;<br>    </p><p><br>&lt;div class="grid"&gt;<br>  &lt;div class="grid-m1"&gt;&lt;/div&gt;<br>  &lt;div class="grid-c1"&gt;<br>    &lt;p class="footer_text"&gt;&lt;strong&gt;&lt;a href="/about_us/"&gt;ABOUT PEAK LABS&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/services/"&gt;PEAK SERVICES&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/resources/"&gt;PEAK RESOURCES&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/contact_us/"&gt;CONTACT US&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;<br>  &lt;/div&gt;<br>  &lt;div class="grid-m2"&gt;&lt;/div&gt;<br>  &lt;div class="grid-c2"&gt;<br>    &lt;p class="footer_text"&gt;&lt;strong&gt;PEAK PRODUCTS&lt;/strong&gt;&lt;br /&gt;<br>    &lt;a href="/products/performer_1tcd.html"&gt;Peak Performer 1 TCD&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/products/performer_1fid.html"&gt;Peak Performer 1 FID&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/products/performer_1rcp.html"&gt;Peak Performer 1 RCP&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/products/performer_1pdd.html"&gt;Peak Performer 1 PDD&lt;/a&gt;&lt;br /&gt;<br>    &lt;a href="/products/performer_2rcp.html"&gt;Peak Performer 2 RCP&lt;/a&gt;&lt;br /&gt;<br>  &lt;/div&gt;<br>  <br> &lt;!
        <div class="grid-m3"></div>
       
         <div class="grid-c3">fadsfds
        </div>
       
       -->
        <div class="grid-m4"></div>
        <div class="grid-c4">
          <p class="footer_contact_text"><strong>PEAK LABORATOIRES, LLC</strong><br />
          2330 Old Middlefield Way, #10 Mtn. View, CA 94043-2452 USA<br />
          Tel: (650) 691-1267 / Fax: (650) 691-1047<br />
          <a href="mailto:peaklaboratories@aol.com">peaklaboratories@aol.com</a></p>
         
          <p class="footer_text">&copy; 2011 All rights reserved.</p>
        </div>
        <br style="clear:both" />
      </div>

       

       

       

       

       

                         

         
         
         
          
         
         
         
         
         
         
         
         
         
         
       </div>
       <br class="clearfloat" /></div>
      </div>

       


        <center>
       <div id="popupContact" style="z-index:9999"><a id="popupContactClose"><img src="/images/close_button.gif" width="18" height="20" border="0" alt="CLOSE WINDOW" /></a><iframe id="popupContent" src="" width="100%" height="100%" id="frame"><p>Your browser does not support iframes.</p></iframe></div><div id="backgroundPopup"></div>

        </center>


      </body>

       

      </html>
      EOD;
      echo "$theResults";
       
       
      ?>