Jump to content

Help with sending mail with PHP


TheBrandon

Recommended Posts

Alright, been having a problem with some websites lately. The host is GoDaddy (I know, I know...).

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<Title>Horticultural Service | Landscape Consultant | W. Florida Panhandle | Landscaping</Title>

<META NAME="Author" CONTENT="Horticultural Service Group">
<META NAME="Subject" CONTENT="Horticultural Service Group offering landscape consulting and Horticultural pruning and trimming.">
<META NAME="Description" CONTENT="Horticultural Service company serving the W. Florida Panhandle region. Offering landscape consulting service and horticultural correct pruning of trees and bushes. Residential landscaping, tree trimming and consulting service.">
<META NAME="Keywords" CONTENT="horticultural service,horticulture, pruning,tree pruning,pruning plants,pruning bushes,tree trimming,landscaping, landscaping yards,residential landscaping,landscape architecture, backyard landscape,W. Florida Panhandle,FL panhandle">
<META NAME="Language" CONTENT="English">
<META NAME="Copyright" CONTENT="© Horticultural Service Group">
<META NAME="Revisit-After" CONTENT="15 Days">
<META NAME="Distribution" CONTENT="Global">
<META NAME="Robots" CONTENT="Follow, All">

<link href="css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<!--===========================================================
Script:   JavaScript Cross-Browser SlideShow Script
          With Cross-Fade Effect between Images
          Adjustable Timing and Unlimited Images
Function: Displays images continuously in a slideshow
          presentation format, with a fade effect on
          image transitions.
Browsers: All common browsers: NS3-6, IE 4-6
          Fade effect only in IE; others degrade gracefully
Author:   etLux
===========================================================

Step 1.
Put the following script in the head of your page:-->



  
  <script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/image_six.jpg'
Pic[1] = 'images/image_two.jpg'
Pic[2] = 'images/image_one.jpg'
Pic[3] = 'images/image_seven.jpg'
Pic[4] = 'images/image_eight.jpg'
Pic[5] = 'images/image_nine.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
  </script>

<script type="text/javascript" src="js/validate.js"></script>

</head>

<body onload="MM_preloadImages('images/title_home_b.jpg','images/title_about_b.jpg','images/title_gallery_b.jpg','images/title_landscape_b.jpg','images/title_services_b.jpg','images/title_contact_b.jpg'), runSlideShow()">
<div align="center">
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3" align="center" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="2"><img src="images/header_top.jpg" alt="Horticultural Services Inc." width="909" height="98" longdesc="index.html" /></td>
        </tr>
        <tr>
          <td width="602" align="left"><img src="images/header_left.jpg" alt="Horticulture Services Group Inc.Inc." width="602" height="185" longdesc="about.html" /></td>
          <td align="left"><img src="images/image_six.jpg" alt="Landschaft" name="SlideShow" width="308" height="185" id="SlideShow" longdesc="index.html" /></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td width="81" height="29"><span class="buttoms_left"><img src="images/buttoms_left.jpg" width="81" height="29" /></span></td>
      <td width="474" align="right" bgcolor="#424242"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="56"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/title_home_b.jpg',1)"><img src="images/title_home.jpg" alt="Home" name="Home" width="56" height="29" border="0" id="Home" /></a></td>
          <td width="75"><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('About Us','','images/title_about_b.jpg',1)"><img src="images/title_about.jpg" alt="About Us" name="About Us" width="75" height="29" border="0" id="About Us" /></a></td>
          <td width="63"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/title_gallery_b.jpg',1)"><img src="images/title_gallery.jpg" alt="Gallery" name="Gallery" width="63" height="29" border="0" id="Gallery" /></a></td>
          <td width="125"><a href="wordpress/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Landscape News','','images/title_landscape_b.jpg',1)"><img src="images/title_landscape.jpg" alt="Landscape News" name="Landscape News" width="125" height="29" border="0" id="Landscape News" /></a></td>
          <td width="71"><a href="services.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Services','','images/title_services_b.jpg',1)"><img src="images/title_services.jpg" alt="Services" name="Services" width="71" height="29" border="0" id="Services" /></a></td>
          <td align="left"><a href="contact.php"><img src="images/title_contact_b.jpg" alt="Contact" name="Contact" width="83" height="29" border="0" id="Contact" /></a></td>
        </tr>
      </table></td>
      <td width="354" align="right"><span class="buttoms_right"><img src="images/buttoms_right.jpg" width="354" height="29" /></span></td>
    </tr>
    <tr>
      <td height="46" colspan="3" class="bottom_header"> </td>
    </tr>
  </table>
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="63" height="426" class="flowers_left"> </td>
      <td align="center" valign="top" class="content_repeat"><table width="725" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="420" align="left" valign="top" class="content_center"><h1><img src="images/titles_contact_us.jpg" alt="Contact Us" width="120" height="17" longdesc="index.html" /></h1>
    <? if(isset($_GET['q'])){ 
	$error = explode(';',urldecode($_GET['q']));?>
    <p class="style1">   
    <? foreach ($error as $mensaje){ ?> 
<? echo $mensaje .'<BR>';
}?>
    </p>
    <? }?>
    <h2>Contact Form:</h2>
<p>Please fill out the information below and a representative will contact you.</p>
<form name="contactForm" id="contactForm" action="sendmail.php" method="post" onSubmit="return validate();">
              <label>First Name:*<br />
                <input name="fname" type="text" id="fname" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>Last Name:*<br />
                <input name="lname" type="text" id="lname" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />                                          
              <label>Address:<br />
                <input name="address" type="text" id="address" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>City:<br />
                <input name="city" type="text" id="city" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>State:<br />
                <select name="state" tabindex="4" id="state" style="border:1px solid #5E748C;">
                  <option value="" selected>Choose a State</option>
                  <option value="AL">Alabama</option>
                  <option value="AK">Alaska</option>
            
                  <option value="AZ">Arizona</option>
                  <option value="AR">Arkansas</option>
                  <option value="CA">California</option>
                  <option value="CO">Colorado</option>
                  <option value="CT">Connecticut</option>
                  <option value="DC">D.C.</option>
            
                  <option value="DE">Delaware</option>
                  <option value="FL">Florida</option>
                  <option value="GA">Georgia</option>
                  <option value="HI">Hawaii</option>
                  <option value="ID">Idaho</option>
                  <option value="IL">Illinois</option>
            
                  <option value="IN">Indiana</option>
                  <option value="IA">Iowa</option>
                  <option value="KS">Kansas</option>
                  <option value="KY">Kentucky</option>
                  <option value="LA">Louisiana</option>
                  <option value="ME">Maine</option>
            
                  <option value="MD">Maryland</option>
                  <option value="MA">Massachusetts</option>
                  <option value="MI">Michigan</option>
                  <option value="MN">Minnesota</option>
                  <option value="MS">Mississippi</option>
                  <option value="MO">Missouri</option>
            
                  <option value="MT">Montana</option>
                  <option value="NE">Nebraska</option>
                  <option value="NV">Nevada</option>
                  <option value="NH">New Hampshire</option>
                  <option value="NJ">New Jersey</option>
                  <option value="NM">New Mexico</option>
            
                  <option value="NY">New York</option>
                  <option value="NC">North Carolina</option>
                  <option value="ND">North Dakota</option>
                  <option value="OH">Ohio</option>
                  <option value="OK">Oklahoma</option>
                  <option value="OR">Oregon</option>
            
                  <option value="PA">Pennsylvania</option>
                  <option value="RI">Rhode Island</option>
                  <option value="SC">South Carolina</option>
                  <option value="SD">South Dakota</option>
                  <option value="TN">Tennessee</option>
                  <option value="TX">Texas</option>
            
                  <option value="UT">Utah</option>
                  <option value="VT">Vermont</option>
                  <option value="VA">Virginia</option>
                  <option value="WA">Washington</option>
                  <option value="WV">West Virginia</option>
                  <option value="WI">Wisconsin</option>
            
                  <option value="WY">Wyoming</option>
                </select>
              </label>
              <br />
              <br />                                           
              <label>Zip:<br />
                <input name="zip" type="text" id="zip" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>Email:<br />
              <input name="email" type="text" id="email" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>Phone Number:*<br />
                <input name="phone" type="text" id="phone" style="border:1px solid #5E748C;" size="25" />
              </label>
              <br />
              <br />
              <label>Contact Method:<br />
                <select name="metod" tabindex="4" id="metod" style="border:1px solid #5E748C;">
                  <option value="Telephone" selected>Telephone</option>
                  <option value="Email">Email</option>
                </select>
              </label>
              <br />
              <br />                                         
              <label>Questions or Comments:<br />
              <textarea name="comments" cols="40" rows="5" wrap="virtual" id="comments" style="border:1px solid #5E748C;"></textarea>
              </label>
              <br />              
              <br />
              <p>*Required Fields</p>
	      <label>
	      <input type="reset" style="border:1px solid #5E748C; background-color:#99CCFF; color:414141;" name="Reset" id="button" value="Reset" />
	      </label>
               
              <label>
	      <input name="submit" style="border:1px solid #5E748C; background-color:#99CCFF; color:414141;" type="submit" value="Send"/>
              </label>
</form>
<br />
<div class="line"></div>
    <h2>Offices:</h2>
    <p align="center"><b>Horticultural Services Group, Inc.</b><br />
    <b>Phone:</b> 850-603-9783<br />
            <b>Fax:</b> 800-521-4213<br />
            <b>Email:</b> <a href="mailto:slarue@hortservicesgroup.com">slarue@hortservicesgroup.com</a></p>
            
            <div align="center">
              <!-- form should mail to jwclairmont@register.com -->
              
            </div></td>
          <td width="215" align="center" valign="top">
           <h1>850-603-9783</h1><div align="right"><h2>Services we Offer:</h2>
              <p class="side_services">
               <a href="commercial.html" title="commercial services">Commercial Landscape Maintenance</a><br/>
               <a href="commercial-landscape-design.html" title="commercial landscape design/build">Commercial Landscape Design/Build</a><br/>
               <a href="residential.html" title="residential services">Residential Landscape Design</a><br/>
               <a href="residential.html" title="residential services">Home Landscape Renovation</a><br/>
               <a href="residential.html" title="residential services">Landscape Construction</a><br/>
               <a href="commercial.html" title="commercial services">Palm Trees</a><br/>
               <a href="commercial.html" title="commercial services">Tree Installation</a><br/>
               <a href="commercial.html" title="commercial services">Fertilizer</a></p>
             </div>
	  <a href="sign_up.php"><img src="images/subscribe_link.jpg" border="0" /></a><br /><br />
	  <img src="images/image_nature.jpg" alt="Nature" width="194" height="195" longdesc="index.html" />
          <p><span class="highlighted">Horticultural Services Group</span><br />
            Phone: <b>850-603-9783</b><br />
            Fax: <b>800-521-4213</b></p>
          <p><a href="organizations.html"><strong>Organizations</strong></a></p>
          <p><a href="http://www.facebook.com/pages/Crestview-FL/Horticulture-Services-Group-Inc/126426941305?ref=ts" target="_blank"><img src="images/facebook.jpg" border="0" /></a></p></td>
        </tr>
      </table></td>
      <td width="51" height="426" class="flowers_right"> </td>
    </tr>
  </table>
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="69" align="center" valign="top" class="footer">
      <a href="index.html">Home</a> | <a href="about.html">About Us</a> | <a href="gallery">Gallery</a> | <a href="wordpress/index.php">Landscape Blog</a> | <a href="contact.php">Contact Us</a> | <a href="wordpress/wp-admin/index.php" style="text-decoration:underline;"><i>Panel Access Management</i></a><br />
      <span id="footer">Copyright ©Horticultural Services Group Inc. All rights reserved. Powered by <a href="http://www.register.com/" target="_blank">Register.com</a></span>      </td>
    </tr>
  </table>
</div>
</body>
</html>

 

Above is the HTML form.

<?php 
if (isset($_POST['submit'])){
$error = array();
// **************************
// add fields validations here
if(empty($_POST['fname'])){
	$error[] = "Please enter your first name.";
}
if(empty($_POST['lname'])){
	$error[] = "Please enter your last name.";
}
if(empty($_POST['phone'])){
	$error[] = "Please enter a phone number.";
}
// **************************
if(count($error) > 0 ){
	$q = urlencode(implode(';',$error));
	header('Location: contact.php?q='.$q);
} else {
	for($i=0;$i<25;$i++){
		if(!empty($_POST['check'.$i]))$aChecks[] = $_POST['check'.$i];
	}
	$industry = implode(" | ",$aChecks);
		$real_time = $_POST['real_time'];
	$hot_transfer = $_POST['hot_transfer'];
	$email = $_POST['email'];
	$fname = $_POST['fname'];
	$lname = $_POST['lname'];
	$metod = $_POST['metod'];
	$company = $_POST['company'];
	$phone = $_POST['phone'];
	$address = $_POST['address'];
	$city = $_POST['city'];	
	$state = $_POST['state'];
	$zip = $_POST['zip'];				
	$comments = $_POST['comments'];

	$Ssubject = "Form message submitted from ".$_SERVER['HTTP_HOST']."\r\n";
	$Sheaders = "From: $name <$email>\r\n";
	$Sheaders .= "Reply-To: $email\r\n";
	$Sheaders .= "X-Mailer: PHP\r\n";
	$Sheaders .= "Mime-Version: 1.0\r\n";
	$Sheaders .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
	$Sheaders .= "Content-Transfer-Encoding: 8bit\r\n";

	$Smsg = "Contact Information.\r\n\r\n";
	$Smsg .= "--------------------------------------------------------------------------- \r\n";    
	$Smsg .= "First Name: $fname\r\n";
	$Smsg .= "Last Name: $lname\r\n";
	$Smsg .= "Address: $address\r\n";
	$Smsg .= "City: $city\r\n";
	$Smsg .= "State: $state\r\n";
	$Smsg .= "Zip: $zip\r\n";
	$Smsg .= "Email: $email\r\n";
	$Smsg .= "Phone: $phone\r\n";
	$Smsg .= "Contact Method: $metod\r\n";						
	$Smsg .= "Questions or Comments: $comments\r\n";
	$Smsg .= "--------------------------------------------------------------------------- \r\n";    

	$sent = mail("todd@revivemediaservices.com", $Ssubject, $Smsg, $Sheaders);

//		echo "SENT:$sent -- EMAIL:$email -- SUBJECT:$Ssubject  --  MSG:$Smsg  -- HEADERS:$Sheaders ";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<Title>Horticultural Service | Landscape Consultant | W. Florida Panhandle | Landscaping</Title>

<META NAME="Author" CONTENT="Horticultural Service Group">
<META NAME="Subject" CONTENT="Horticultural Service Group offering landscape consulting and Horticultural pruning and trimming.">
<META NAME="Description" CONTENT="Horticultural Service company serving the W. Florida Panhandle region. Offering landscape consulting service and horticultural correct pruning of trees and bushes. Residential landscaping, tree trimming and consulting service.">
<META NAME="Keywords" CONTENT="horticultural service,horticulture, pruning,tree pruning,pruning plants,pruning bushes,tree trimming,landscaping, landscaping yards,residential landscaping,landscape architecture, backyard landscape,W. Florida Panhandle,FL panhandle">
<META NAME="Language" CONTENT="English">
<META NAME="Copyright" CONTENT="© Horticultural Service Group">
<META NAME="Revisit-After" CONTENT="15 Days">
<META NAME="Distribution" CONTENT="Global">
<META NAME="Robots" CONTENT="Follow, All">

<link href="css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<!--===========================================================
Script:   JavaScript Cross-Browser SlideShow Script
          With Cross-Fade Effect between Images
          Adjustable Timing and Unlimited Images
Function: Displays images continuously in a slideshow
          presentation format, with a fade effect on
          image transitions.
Browsers: All common browsers: NS3-6, IE 4-6
          Fade effect only in IE; others degrade gracefully
Author:   etLux
===========================================================

Step 1.
Put the following script in the head of your page:-->



  
  <script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/image_eight.jpg'
Pic[1] = 'images/image_two.jpg'
Pic[2] = 'images/image_six.jpg'
Pic[3] = 'images/image_seven.jpg'
Pic[4] = 'images/image_one.jpg'
Pic[5] = 'images/image_nine.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
  </script>

</head>

<body onload="MM_preloadImages('images/title_home_b.jpg','images/title_about_b.jpg','images/title_gallery_b.jpg','images/title_landscape_b.jpg','images/title_services_b.jpg','images/title_contact_b.jpg'), runSlideShow()">
<div align="center">
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3" align="center" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="2"><img src="images/header_top.jpg" alt="Horticultural Services Inc." width="909" height="98" longdesc="index.html" /></td>
        </tr>
        <tr>
          <td width="602" align="left"><img src="images/header_left.jpg" alt="Horticulture Services Group Inc.Inc." width="602" height="185" longdesc="about.html" /></td>
          <td align="left"><img src="images/image_eight.jpg" alt="Landschaft" name="SlideShow" width="308" height="185" id="SlideShow" longdesc="index.html" /></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td width="81" height="29"><span class="buttoms_left"><img src="images/buttoms_left.jpg" width="81" height="29" /></span></td>
      <td width="474" align="right" bgcolor="#424242"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="56"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/title_home_b.jpg',1)"><img src="images/title_home.jpg" alt="Home" name="Home" width="56" height="29" border="0" id="Home" /></a></td>
          <td width="75"><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('About Us','','images/title_about_b.jpg',1)"><img src="images/title_about.jpg" alt="About Us" name="About Us" width="75" height="29" border="0" id="About Us" /></a></td>
          <td width="63"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/title_gallery_b.jpg',1)"><img src="images/title_gallery.jpg" alt="Gallery" name="Gallery" width="63" height="29" border="0" id="Gallery" /></a></td>
          <td width="125"><a href="wordpress/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Landscape News','','images/title_landscape_b.jpg',1)"><img src="images/title_landscape.jpg" alt="Landscape News" name="Landscape News" width="125" height="29" border="0" id="Landscape News" /></a></td>
          <td width="71"><a href="services.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Services','','images/title_services_b.jpg',1)"><img src="images/title_services.jpg" alt="Services" name="Services" width="71" height="29" border="0" id="Services" /></a></td>
          <td align="left"><a href="contact.php"><img src="images/title_contact_b.jpg" alt="Contact" name="Contact" width="83" height="29" border="0" id="Contact" /></a></td>
        </tr>
      </table></td>
      <td width="354" align="right"><span class="buttoms_right"><img src="images/buttoms_right.jpg" width="354" height="29" /></span></td>
    </tr>
    <tr>
      <td height="46" colspan="3" class="bottom_header"> </td>
    </tr>
  </table>
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="63" height="426" class="flowers_left"> </td>
      <td align="center" valign="top" class="content_repeat"><table width="725" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="420" align="left" valign="top" class="content_center"><h1><img src="images/titles_contact_us.jpg" alt="Contact Us" width="120" height="17" longdesc="index.html" /></h1>
            <p>Thanks! We will contact you soon, <a href="index.html">back to Home</a>.</p>
		</td>
          <td width="215" align="center" valign="top">
	  <a href="sign_up.php"><img src="images/subscribe_link.jpg" border="0" /></a><br /><br />
	  <img src="images/image_nature.jpg" alt="Nature" width="194" height="195" longdesc="index.html" />
          <p><span class="highlighted">Horticultural Services Group</span><br />
            Phone: <b>850-603-9783</b><br />
            Fax: <b>800-521-4213</b></p>
          <p><a href="organizations.html"><strong>Organizations</strong></a></p>
          <p><a href="http://www.facebook.com/pages/Crestview-FL/Horticulture-Services-Group-Inc/126426941305?ref=ts" target="_blank"><img src="images/facebook.jpg" border="0" /></a></p></td>
        </tr>
      </table></td>
      <td width="51" height="426" class="flowers_right"> </td>
    </tr>
  </table>
  <table width="909" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="69" align="center" valign="top" class="footer">
      <a href="index.html">Home</a> | <a href="about.html">About Us</a> | <a href="gallery">Gallery</a> | <a href="wordpress/index.php">Landscape Blog</a> | <a href="contact.php">Contact Us</a> | <a href="wordpress/wp-admin/index.php" style="text-decoration:underline;"><i>Panel Access Management</i></a><br />
      <span id="footer">Copyright ©Horticultural Services Group Inc. All rights reserved. Powered by <a href="http://www.register.com/" target="_blank">Register.com</a></span>      </td>
    </tr>
  </table>
</div>
</body>
</html>

 

That's the processing script right now.

 

When we use that we do not receive an email.

 

So trying to figure out what was up, we made this file:

<?php 
mail("todd@revivemediaservices.com", "test message from godaddy", "this is a test message, if you are reading this the email was sent successfully."); 
?>

 

When we use that, we receive the email although it takes about 15+ minutes.

 

In our troubleshooting, we took a script off of my website and tested it. That's this code:

<?php require_once('wp-blog-header.php');?>
<?php require_once('magpierss/rss_fetch.inc');?>
<?php require_once('_inc/functions.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="wp-content/themes/bp/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="wp-content/themes/bp/style.css" type="text/css" media="screen" />

<!--[if IE]> <link href="<?php bloginfo('template_url'); ?>/ie_only.css" rel="stylesheet" type="text/css"> <![endif]-->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<meta name="generator" content="Brandon Pence" />
<meta name="keywords" content="brandon pence, digital artist, florida, gulf coast, niceville, modern artist," /> 
<meta name="description" content="The official website of the artist Brandon Pence. Living in the Gulf Coast of Florida, Brandon Pence is a modern digital artist." /> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> 
<script type="text/javascript" src="js/jquery.newsticker.js"></script> 
<script type="text/javascript"> 
$(document).ready(
function()
{
	$("#news").newsTicker();
	parseSamples();
}
);
</script> 
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/protoformclass.js" type="text/javascript"></script>
<script type="text/javascript">
Event.observe(window,"load",function() {
     
new Protoform('test');     
  
});
</script>
<?php wp_head();?>
</head>
<body>
<div id="container">

<?php include("inc/contact.php");?>

<?php include("inc/top.php");?>

<div id="menu">
	<ul>
		<?php wp_list_pages('title_li='); ?>
	</ul>
</div>

<div class="clear"></div>

<div class="hr"><hr /></div>

<div id="box">
	<form action="send.php" method="post" id="test">
		<fieldset>
			<legend>Contact Brandon Pence</legend>
			<div>
				<label for="name_Req">Name<span class="asterisk">  *</span></label>
				<input type="text" id="name_Req" name="name" title="Required! Please enter your name" />
			</div>
			<div>
				<label for="contact_Req_Email">E-mail<span class="asterisk">  *</span></label>
				<input type="text" id="contact_Req_Email" name="email" title="Required! Please enter a valid email address" />
			</div>
			<div>
				<label for="telephone_Tel">Telephone</label>
				<input type="text" id="telephone" name="telephone" title="Please enter a valid telephone number" />
			</div>                
			<div>
				<label for="message_Req">Message<span class="asterisk">  *</span></label>
				<textarea id="message_Req" name="message" rows="5" cols="20" title="Required! Please enter your message"></textarea>
			</div>
			<div class="button">
				<input type="submit" value="Send" />
        		</div>
		</fieldset>
	</form>
</div><!-- /#box -->

<div class="clear"></div>

 

And it's processing script:

<?php
echo "<div id=\"response\">";


  $name            = $_POST['name'];
  $email           = $_POST['email'];
  $telephone       = $_POST['telephone'];
  $message         = $_POST['message'];
  
  if ( ($name=='') && ($email=='') && ($telephone=='') && ($message=='')) { 
  
  		echo "<p>Please fill all the required fields<span>*</span></em></p>";
  	
  } else {
  
	$to = "brandonpence@gmail.com";
	$subject = "[brandon.pence.com] contact form";
	$body = 'Message: '.$message.'
Telephone: '.$telephone.'
Email: '.$email;

	if (mail($to, $subject, $body)) {
		echo("<h2>message sent!</h2>");
	} else {
		echo("<h2>message failed</h2>");
	}
	  
	echo "<ul>";
	echo "<li>Name: ".$name."</li>";
 	echo "<li>E-mail: ".$email."</li>";
	echo "<li>Telephone: ".$telephone."</li>";
	echo "<li>Message:".$message."</li>";
	echo "</ul>";
  }  
  echo "</div>";
?>         
            
            
            

 

This email was not received.

 

Again in our troubleshooting, we tried another script we have...

 

<?php include('includes/head-open.php');?>
<title><?php echo $site_title; ?></title>
<meta name="generator" content="Revive Media Services" />
<meta name="keywords" content="fort walton beach condo rentals, beach rentals, okaloosa island, beachfront rental, beachfront condo, okaloosa island condo, okaloosa island rental," />
<meta name="description" content="Rates, photos, and contact information for The Breakers on Fort Walton Beach. Accommodations include condo style rentals and beachfront access" />
<?php include('includes/style.php');?>
<?php include('includes/head-close.php');?>
<?php include('includes/body-open.php');?>
<?php include('includes/head.php');?>
<?php include('includes/menu.php');?>
<?php include('includes/hr.php');?>
<?php include('includes/content-open.php'); ?>
<div style="margin:20px">
<h1>Contact the Breakers</h1>
<form method="post" action="process.php"><table width="355" bgcolor="#EEEEEE" border="0"><tr><td valign="top">Name</td><td valign="top"><input type="text" name="t1"></td></tr><tr><td valign="top">Email Address</td><td valign="top"><input type="email" name="t2"></td></tr><tr><td valign="top">Message</td><td valign="top"><textarea name="t3" cols="20" rows="10">Your message here</textarea></td></tr><tr><td><input type="submit" value="Submit"></td></tr></table></form>
</div>
<?php include('includes/content-close.php'); ?>
</div>
</div>
<?php include('includes/right-bg.php'); ?>
<?php include('includes/body-close.php'); ?>

 

And it's processing script...

<?
$mymail = 'info@breakersfwb.com';
//$mymail = 'Brandon@ReviveMediaServices.com';
$cc = 'Form submitted from your website';
$BoDy = ' ';
$FrOm = 'FROM:' .$_POST['t1'];
$FrOm .= 'Reply-To:' .$_POST['t1'];
$FrOm .= 'X-MAILER: PHP'.phpversion();
$BoDy .= 'First Name: ';
$BoDy .= $_POST['t1'];
$BoDy .= "\n";
$BoDy .= 'Last Name: ';
$BoDy .= $_POST['t5'];
$BoDy .= "\n";
$BoDy .= 'Email Address: ';
$BoDy .= $_POST['t2'];
$BoDy .= "\n";
$BoDy .= 'Zip Code: ';
$BoDy .= $_POST['t4'];
$BoDy .= "\n";
$BoDy .= 'Message: ';
$BoDy .= $_POST['t3'];
$BoDy .= "\n";
$send = mail("$mymail", "$cc", "$BoDy", "$FrOm");
///Redirect user to your homepage....
if($send)
{
echo '<html><head>';
echo '<meta http-equiv="refresh" content="0;URL=http://www.breakersfwb.com">';
echo '</head><body>Email send....';
echo '</body></html>';
}
?>

 

That email worked.

 

I guess my basic question is why do some of these work and some don't? We're sending emails in a bunch of different ways but I'd like to understand exactly which line is making it work or not work.

 

I thought maybe it was the header info with the X-MAILER, but the 1 line mail() code worked and it doesn't have that.

 

Can someone please shed some light on the intricacies of sending server generated emails from godaddy hosts to godaddy email accounts?

 

 

 

Link to comment
Share on other sites

I am somewhat new to php, but I also use godaddy for hosting. I noticed that when I try and send an email that has a variable or $POST data in the subject line, it does not send - and doesn't give an error message. Not sure if this is your problem, but I would try hardcoding the subject line in your mail script and see if it sends. Just to rule it out. It seems odd that they would not let you do this, but I haven't been able to get it to work for some reason.

 

Hope it helps. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.