PHP Email Problems

Having problems recieving emails with the selected fields

Page 1 of 1

14 Replies - 857 Views - Last Post: 22 May 2009 - 05:18 AM Rate Topic: -----

#1 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

PHP Email Problems

Posted 20 May 2009 - 06:25 PM

I am receiving emails but it doesn't have any of the submitted info but the labels are appearing. Please help. Here is the Code for reference first is the PHP and the second is the HTML linked page.

<?php

/* Subject and email variables */

	$emailSubject = 'Information Request';
	$webMaster = 'pdbader@gmail.com';
	

/* Gathering Data Variables */

	$nameField = $_POST['name'];
	$emailField = $_POST['email'];
	$koalaField = $_POST['KoalaKlip'];
	$thermalearField = $_POST['thermalear'];
	$propyeaseField = $_POST['propyease'];
	$requestField = $_POST['request'];
	
	$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Koala: $KoalaKlip <br>
Thermal: $thermalear <br>
Propyease: $propyease <br>
Message: $request <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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #1a628b;
	background-image: url();
	background-repeat: no-repeat;
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style7 {color: #FFFFFF}
-->
</style>
<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>
</head>

<body onload="MM_preloadImages('Images/homebutton2.jpg','Images/aboutusbutton2.jpg','Images/products2.jpg','Images/contact1.jpg')">
<div id="outerglow">
  <div id="wrapper">
	<div id="header">
	  <div id="logo"><img src="Images/Header.jpg" alt="" name="Logo" width="740" height="198" id="Logo" /></div>
	  <div id="nav"><img src="Images/menu1.jpg" alt="" name="Navigation" width="53" height="25" id="Navigation" /><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home1','','Images/homebutton2.jpg',1)"><img src="Images/homebutton.jpg" name="home1" width="70" height="25" border="0" id="home1" /></a><img src="Images/menu2.jpg" width="79" height="25" /><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','Images/aboutusbutton2.jpg',1)"><img src="Images/aboutusbutton.jpg" name="about" width="103" height="25" border="0" id="about" /></a><img src="Images/menu3.jpg" width="91" height="25" /><a href="product.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('products','','Images/products2.jpg',1)"><img src="Images/products.jpg" name="products" width="106" height="25" border="0" id="products" /></a><img src="Images/menu4.jpg" width="100" height="25" /><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','Images/contact1.jpg',1)"><img src="Images/contact.jpg" name="contact" width="98" height="25" border="0" id="contact" /></a><img src="Images/menu5.jpg" width="40" height="25" /></div>
	</div>
	<div id="text">
	  <blockquote>
		<p align="left" class="style1">Thank you for your interest in Advent Medical Products. You will have a response within 48 hours.</p>
		<p align="center" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
		<p align="left" class="style1"></p>
	  </blockquote>
	</div>
	<div id="content">
	  <div id="leftcolumn">
		<div align="left">
		  <blockquote>
			<p></p>
		  </blockquote>
		</div>
	  </div>
	  <div id="rightcolumn"></div>
	</div>
	<div id="footer">
	  <p></p>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p><img src="Images/footer.jpg" width="740" height="200" /></p>
	</div>
  </div>
</div>
</body>
</html>
EOD;
echo "$theResults"; 

?>



<!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>Untitled Document</title>
<style type="text/css">
<!--
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #1a628b;
	background-image: url();
	background-repeat: no-repeat;
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<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>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style3 {font-size: 9px}
-->
</style>
</head>

<body onload="MM_preloadImages('Images/homebutton2.jpg','Images/aboutusbutton2.jpg','Images/products2.jpg','Images/contact1.jpg')">
<div id="outerglow">
  <div id="wrapper">
	<div id="header">
	  <div id="logo"><img src="Images/Header.jpg" alt="" name="Logo" width="740" height="198" id="Logo" /></div>
	  <div id="nav"><img src="Images/menu1.jpg" alt="" name="Navigation" width="53" height="25" id="Navigation" /><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home1','','Images/homebutton2.jpg',1)"><img src="Images/homebutton.jpg" name="home1" width="70" height="25" border="0" id="home1" /></a><img src="Images/menu2.jpg" width="79" height="25" /><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','Images/aboutusbutton2.jpg',1)"><img src="Images/aboutusbutton.jpg" name="about" width="103" height="25" border="0" id="about" /></a><img src="Images/menu3.jpg" width="91" height="25" /><a href="product.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('products','','Images/products2.jpg',1)"><img src="Images/products.jpg" name="products" width="106" height="25" border="0" id="products" /></a><img src="Images/menu4.jpg" width="100" height="25" /><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','Images/contact1.jpg',1)"><img src="Images/contact.jpg" name="contact" width="98" height="25" border="0" id="contact" /></a><img src="Images/menu5.jpg" width="40" height="25" /></div>
	</div>
	<div id="text">
	  <blockquote>
		<p class="style1">Thank you for you interest in Advent Medical and our Products. To request additional information please indicate in the form below. </p>
	  </blockquote>
	  <fieldset>
	  <legend class="style1">Request Information</legend>
	  <FORM ACTION="/contactformprocess.php" METHOD="POST"> 
		<INPUT TYPE=hidden name="recipient" value="pdbader@gmail.com"> 
		<div align="center">
		  <table width="65%" border="0">
			<tr>
			  <td width="17%"><label for="name">
				<div align="right"><span class="style1">Name:</span></div>
			  </label></td>
			<td width="83%"><input name="name" type="text" id="name" accesskey="c" tabindex="10" value="Full Name" /></td>
		  </tr>
			<tr>
			  <td><label for="label">
				<div align="right"><span class="style1">Email:</span></div>
			  </label></td>
			<td><span id="sprytextfield3">
			  <input type="text" name="email" id="email" accesskey="e" tabindex="20" />
			  <span class="style1 textfieldRequiredMsg style3"><em>Required.</em></span><span class="style1 textfieldInvalidFormatMsg style3"><em>Required</em></span></span></td>
		  </tr>
			<tr>
			  <td></td>
			<td></td>
		  </tr>
			<tr>
			  <td></td>
			<td><label for="request">
			  <input name="KoalaKlip" type="checkbox" id="KoalaKlip" accesskey="i" tabindex="25" value="Koala Klip " />
			  </label>
			  <img src="Images/koala_logo.jpg" width="192" height="45" hspace="10" /> </td>
		  </tr>
			<tr>
			  <td></td>
			<td><input name="thermalear" type="checkbox" id="thermalear" accesskey="j" tabindex="27" value="Thermal Ear" />
			  <label for="thermalear"></label>
			  <img src="Images/thermalear.jpg" width="253" height="57" hspace="10" /></td>
		  </tr>
			<tr>
			  <td></td>
			<td><input name="prophyease" type="checkbox" id="prophyease" value="Propyease" />
			  <label for="prophyease"></label>
			  <img src="Images/prophyease.jpg" width="235" height="52" hspace="10" /></td>
		  </tr>
			<tr>
			  <td></td>
			<td></td>
		  </tr>
			<tr>
			  <td></td>
			<td></td>
		  </tr>
			<tr>
			  <td></td>
			<td><textarea name="request" id="request" cols="45" rows="5" accesskey="b" tabindex="30">Please specify the products you are interested in and how we may contact you.</textarea></td>
		  </tr>
			<tr>
			  <td></td>
			  <td></td>
			</tr>
			<tr>
			  <td></td>
			  <td><label for="submit"></label>
				<label for="reset"></label>
				<input type="reset" name="reset" id="reset" value="Reset" accesskey="p" tabindex="100" />
			  <input type="submit" name="submit" id="submit" value="Submit" accesskey="s" tabindex="140" /></td>
			</tr>
		  </table>
		</div>
	  </form>
	  </fieldset>
	</div>
	<div id="footer"><blockquote></blockquote>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p></p>
	  <p><img src="Images/footer.jpg" width="740" height="200" /></p>
	</div>
  </div>
</div>
<script type="text/javascript">
<!--
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email", {validateOn:["blur"]});
//-->
</script>
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: PHP Email Problems

#2 ShaneK  Icon User is offline

  • require_once("brain.php"); //Fatal error :/
  • member icon

Reputation: 239
  • View blog
  • Posts: 1,224
  • Joined: 10-May 09

Re: PHP Email Problems

Posted 20 May 2009 - 07:02 PM

You named your variables things like "$nameField" and when you were putting them in the body you just said "$name", I'm not sure I fully understand your code, but could that have anything to do with it?

[Edit] Also, on your Koala field you capitalized it on one and minimized it on the other and one is Field and the other is Klip....all your variables are named incorrectly (or differently)...

Yours,
Shane~

This post has been edited by ShaneK: 20 May 2009 - 07:08 PM

Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5066
  • View blog
  • Posts: 26,448
  • Joined: 10-May 07

Re: PHP Email Problems

Posted 20 May 2009 - 07:03 PM

What does your variable $body look like prior to sending the email?

Can you throw an echo in there to visually verify it?
Was This Post Helpful? 0
  • +
  • -

#4 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

Re: PHP Email Problems

Posted 20 May 2009 - 07:47 PM

this is the tutorial i followed
http://tutvid.com/tu...FormHandler.php
i am new to this and may have missed something simple. i tried to follow and adapt what the tutorial was to my own site.

this is the site and page i am working on, http://adventmedical...om/contact.html

I am receiving an email with the following

Name:
Email:
Koala:
Thermal:
Propyease:
Message:

But i am not receiving the textfields entered. I hope this helps. Thanks for your help!
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5066
  • View blog
  • Posts: 26,448
  • Joined: 10-May 07

Re: PHP Email Problems

Posted 20 May 2009 - 07:50 PM

Then, change your body to match this :

$body = "<br><hr><br>";
$body .= "Name: ".$name." <br>";
$body .= "Email: ".$email." <br>";
$body .= "Koala: ".$KoalaKlip." <br>";
$body .= "Thermal: ".$thermalear." <br>";
$body .= "Propyease: ".$propyease." <br>";
$body .= "Message: ".$request." <br>";



That directional stuff is usually a bad culprit.
Was This Post Helpful? 0
  • +
  • -

#6 ShaneK  Icon User is offline

  • require_once("brain.php"); //Fatal error :/
  • member icon

Reputation: 239
  • View blog
  • Posts: 1,224
  • Joined: 10-May 09

Re: PHP Email Problems

Posted 20 May 2009 - 07:58 PM

View Postno2pencil, on 20 May, 2009 - 07:50 PM, said:

Then, change your body to match this :

$body = "<br><hr><br>";
$body .= "Name: ".$name." <br>";
$body .= "Email: ".$email." <br>";
$body .= "Koala: ".$KoalaKlip." <br>";
$body .= "Thermal: ".$thermalear." <br>";
$body .= "Propyease: ".$propyease." <br>";
$body .= "Message: ".$request." <br>";



That directional stuff is usually a bad culprit.


That actually doesn't matter, according to PHP.net's topic on strings it's a proper way to make multi-line strings.

Change the body to match this:
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Koala: $koalaField <br>
Thermal: $thermalearField <br>
Propyease: $propyeaseField <br>
Message: $requestField <br>
EOD;


You're following a tutorial, but apparently whoever made it doesn't understand how to give their variables the same name.

Yours,
Shane~
Was This Post Helpful? 0
  • +
  • -

#7 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

Re: PHP Email Problems

Posted 20 May 2009 - 08:37 PM

View PostShaneK, on 20 May, 2009 - 06:58 PM, said:

View Postno2pencil, on 20 May, 2009 - 07:50 PM, said:

Then, change your body to match this :

$body = "<br><hr><br>";
$body .= "Name: ".$name." <br>";
$body .= "Email: ".$email." <br>";
$body .= "Koala: ".$KoalaKlip." <br>";
$body .= "Thermal: ".$thermalear." <br>";
$body .= "Propyease: ".$propyease." <br>";
$body .= "Message: ".$request." <br>";



That directional stuff is usually a bad culprit.


That actually doesn't matter, according to PHP.net's topic on strings it's a proper way to make multi-line strings.

Change the body to match this:
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Koala: $koalaField <br>
Thermal: $thermalearField <br>
Propyease: $propyeaseField <br>
Message: $requestField <br>
EOD;


You're following a tutorial, but apparently whoever made it doesn't understand how to give their variables the same name.

Yours,
Shane~



PERFECT!!!!! Thank you for your help. Everything is coming through perfectly except a few minimal things.

In the "From" field in the email it isnt showing the submitted email, is that a problem with the variables as well? And i am getting 2 emails for each submition, is there a fix for this.

Thank you again

Last thing. i am really trying to learn as much as i can, does anyone have any recommendations for "userfriendly" books that cover a vast amount of info or video tutorials that i can refer to?
Was This Post Helpful? 0
  • +
  • -

#8 ShaneK  Icon User is offline

  • require_once("brain.php"); //Fatal error :/
  • member icon

Reputation: 239
  • View blog
  • Posts: 1,224
  • Joined: 10-May 09

Re: PHP Email Problems

Posted 20 May 2009 - 08:59 PM

Ah, yes, sorry I skimmed over that part.

$headers = "From: $email\r\n";

Should be
$headers = "From: $emailField\r\n";


I don't know about the two emails thing, I'm too tired to look at the code fully right now.

I started learning php here. But that was before he was charging for video tutorials - though, I still believe he has some free ones out there.

Yours,
Shane~
Was This Post Helpful? 0
  • +
  • -

#9 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: PHP Email Problems

Posted 20 May 2009 - 11:10 PM

Check Here
Was This Post Helpful? 0
  • +
  • -

#10 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

Re: PHP Email Problems

Posted 21 May 2009 - 11:30 AM

The email problem has been fixed but i am receiving 2 emails per submittion, one from the indicated email address and anothing from something random. Can anyone see what is causing this? thanks
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5066
  • View blog
  • Posts: 26,448
  • Joined: 10-May 07

Re: PHP Email Problems

Posted 21 May 2009 - 11:32 AM

Can you post your most recent code?

Do you have more than one call to the function "mail()"?
Was This Post Helpful? 0
  • +
  • -

#12 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

Re: PHP Email Problems

Posted 21 May 2009 - 12:29 PM

Here is the most recent code

<?php

/* Subject and email variables */

	$emailSubject = 'Information Request';
	$webMaster = 'pdbader@gmail.com';
	

/* Gathering Data Variables */

	$nameField = $_POST['name'];
	$emailField = $_POST['email'];
	$koalaField = $_POST['KoalaKlip'];
	$thermalearField = $_POST['thermalear'];
	$propyeaseField = $_POST['propyease'];
	$requestField = $_POST['request'];
	
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Koala: $koalaField <br>
Thermal: $thermalearField <br>
Propyease: $propyeaseField <br>
Message: $requestField <br>
EOD;

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

	$theResults = <<<EOD
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #1a628b;
	background-image: url();
	background-repeat: no-repeat;
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style7 {color: #FFFFFF}
-->
</style>
<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>
</head>

<body onload="MM_preloadImages('Images/homebutton2.jpg','Images/aboutusbutton2.jpg','Images/products2.jpg','Images/contact1.jpg')">
<div id="outerglow">
  <div id="wrapper">
	<div id="header">
	  <div id="logo"><img src="Images/Header.jpg" alt="" name="Logo" width="740" height="198" id="Logo" /></div>
	  <div id="nav"><img src="Images/menu1.jpg" alt="" name="Navigation" width="53" height="25" id="Navigation" /><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home1','','Images/homebutton2.jpg',1)"><img src="Images/homebutton.jpg" name="home1" width="70" height="25" border="0" id="home1" /></a><img src="Images/menu2.jpg" width="79" height="25" /><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','Images/aboutusbutton2.jpg',1)"><img src="Images/aboutusbutton.jpg" name="about" width="103" height="25" border="0" id="about" /></a><img src="Images/menu3.jpg" width="91" height="25" /><a href="product.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('products','','Images/products2.jpg',1)"><img src="Images/products.jpg" name="products" width="106" height="25" border="0" id="products" /></a><img src="Images/menu4.jpg" width="100" height="25" /><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','Images/contact1.jpg',1)"><img src="Images/contact.jpg" name="contact" width="98" height="25" border="0" id="contact" /></a><img src="Images/menu5.jpg" width="40" height="25" /></div>
	</div>
	<div id="text">
	  <blockquote>
		<p align="left" class="style1">Thank you for your interest in Advent Medical Products. You will have a response within 48 hours.</p>
		<p align="center" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
	  </blockquote>
	</div>
	<div id="content">
	  <div id="leftcolumn">
		<div align="left">
		  <blockquote>
			<p>&nbsp;</p>
		  </blockquote>
		</div>
	  </div>
	  <div id="rightcolumn"></div>
	</div>
	<div id="footer">
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p><img src="Images/footer.jpg" width="740" height="200" /></p>
	</div>
  </div>
</div>
</body>
</html>
EOD;
echo "$theResults"; 

?>


Was This Post Helpful? 0
  • +
  • -

#13 Wimpy  Icon User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: PHP Email Problems

Posted 21 May 2009 - 05:07 PM

I can't see any problems in there, are the two emails you are receiving identical or are they entirely different or somewhere in between? :) Post the emails!

View Postpdbader, on 21 May, 2009 - 09:29 PM, said:

Here is the most recent code

<?php

/* Subject and email variables */

	$emailSubject = 'Information Request';
	$webMaster = 'pdbader@gmail.com';
	

/* Gathering Data Variables */

	$nameField = $_POST['name'];
	$emailField = $_POST['email'];
	$koalaField = $_POST['KoalaKlip'];
	$thermalearField = $_POST['thermalear'];
	$propyeaseField = $_POST['propyease'];
	$requestField = $_POST['request'];
	
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Koala: $koalaField <br>
Thermal: $thermalearField <br>
Propyease: $propyeaseField <br>
Message: $requestField <br>
EOD;

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

	$theResults = <<<EOD
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #1a628b;
	background-image: url();
	background-repeat: no-repeat;
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style7 {color: #FFFFFF}
-->
</style>
<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>
</head>

<body onload="MM_preloadImages('Images/homebutton2.jpg','Images/aboutusbutton2.jpg','Images/products2.jpg','Images/contact1.jpg')">
<div id="outerglow">
  <div id="wrapper">
	<div id="header">
	  <div id="logo"><img src="Images/Header.jpg" alt="" name="Logo" width="740" height="198" id="Logo" /></div>
	  <div id="nav"><img src="Images/menu1.jpg" alt="" name="Navigation" width="53" height="25" id="Navigation" /><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home1','','Images/homebutton2.jpg',1)"><img src="Images/homebutton.jpg" name="home1" width="70" height="25" border="0" id="home1" /></a><img src="Images/menu2.jpg" width="79" height="25" /><a href="about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','Images/aboutusbutton2.jpg',1)"><img src="Images/aboutusbutton.jpg" name="about" width="103" height="25" border="0" id="about" /></a><img src="Images/menu3.jpg" width="91" height="25" /><a href="product.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('products','','Images/products2.jpg',1)"><img src="Images/products.jpg" name="products" width="106" height="25" border="0" id="products" /></a><img src="Images/menu4.jpg" width="100" height="25" /><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','Images/contact1.jpg',1)"><img src="Images/contact.jpg" name="contact" width="98" height="25" border="0" id="contact" /></a><img src="Images/menu5.jpg" width="40" height="25" /></div>
	</div>
	<div id="text">
	  <blockquote>
		<p align="left" class="style1">Thank you for your interest in Advent Medical Products. You will have a response within 48 hours.</p>
		<p align="center" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
		<p align="left" class="style1">&nbsp;</p>
	  </blockquote>
	</div>
	<div id="content">
	  <div id="leftcolumn">
		<div align="left">
		  <blockquote>
			<p>&nbsp;</p>
		  </blockquote>
		</div>
	  </div>
	  <div id="rightcolumn"></div>
	</div>
	<div id="footer">
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p><img src="Images/footer.jpg" width="740" height="200" /></p>
	</div>
  </div>
</div>
</body>
</html>
EOD;
echo "$theResults"; 

?>


Was This Post Helpful? 0
  • +
  • -

#14 pdbader  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-May 09

Re: PHP Email Problems

Posted 21 May 2009 - 07:10 PM

This first is the email i want... the second is the one i don't want! haha im getting both!

From: blahblah@blahbla.com
Date: May 21, 2009 10:05:36 PM EDT
To: pdbader@gmail.com
Subject: Information Request




Name: Patrick Bader
Email: blahblah@blahbla.com
Koala: Koala Klip
Thermal:
Propyease:
Message: This is your message


From: adventmedical@p3nlh052.shr.prod.phx3.secureserver.net
Date: May 21, 2009 10:05:36 PM EDT
To: pdbader@gmail.com
Subject: Information Request




Name:
Email:
Koala:
Thermal:
Propyease:
Message:
Was This Post Helpful? 0
  • +
  • -

#15 Wimpy  Icon User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: PHP Email Problems

Posted 22 May 2009 - 05:18 AM

Never seen anything like that, to me that looks like either your web hosting company sends an additional email through secureserver.net or that your email provider does it. Try setting up a hotmail account and send an email to it, if you get the same result I think you should contact your web host and ask what's up with that! :)

View Postpdbader, on 22 May, 2009 - 04:10 AM, said:

This first is the email i want... the second is the one i don't want! haha im getting both!

From: blahblah@blahbla.com
Date: May 21, 2009 10:05:36 PM EDT
To: pdbader@gmail.com
Subject: Information Request




Name: Patrick Bader
Email: blahblah@blahbla.com
Koala: Koala Klip
Thermal:
Propyease:
Message: This is your message


From: adventmedical@p3nlh052.shr.prod.phx3.secureserver.net
Date: May 21, 2009 10:05:36 PM EDT
To: pdbader@gmail.com
Subject: Information Request




Name:
Email:
Koala:
Thermal:
Propyease:
Message:

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1