Trying to create email form but getting syntex error

Hey all,

I am just learning php and I am trying to create an email template. Basically what I am going for is I can go to a page, fill out a quote and the info is delivered to the email I put it. The issue is I am wanting it to be laid out in html.

Well I have laid out the ground work for the email temp but I am getting a syntex error. (Line #47 it is the first line that starts the table)

<?php

	$email = $_POST ['email'];
	$quote = $_POST ['quote'];
	$item = $_POST ['item'];
	$inventory = $_POST ['inventory'];
	$category = $_POST ['category'];
	$manu = $_POST ['manu'];
	$model = $_POST ['model'];
	$condition = $_POST ['condition'];
	$dimension = $_POST ['dimension'];
	$desc = $_POST ['desc'];
	$skidprice = $_POST ['skidprice'];
	$unitprice = $_POST ['unitprice'];
	$totalprice = $_POST ['totalprice'];
	$img1 = $_POST ['img1'];
	$img2 = $_POST ['img2'];
	$img3 = $_POST ['img3'];
	$img4 = $_POST ['img4'];
	$img5 = $_POST ['img5'];
	
	
	
	// contact to database

$connect = mysql_connect("localhost", "DATA-USER", "PASSWORD") or die ("Error , check your server connection.");

mysql_select_db("DATA-NAME");
	

	
	// Always set content-type when sending HTML email
	$headers = "MIME-Version: 1.0" . "\\r\
";
	$headers .= "Content-type:text/html;charset=iso-8859-1" . "\\r\
";

	// More headers
	$headers .= 'From: <sales@allfoodequip.com>' . "\\r\
";

	$headers .= "Message-ID: <".$now." sales@".$_SERVER['SERVER_NAME'].">\\r\
";
    $headers .= "X-Mailer: PHP v".phpversion()."\\r\
";         
 
	$subject = "Your All Food Equip Quote";
	
	$msg = 
			"
			
	<b>		  <table width="700" border="0" ></b>
    <tr>
      <td width="119">Quote #: </td>
      <td width="208">$quote</td>
    </tr>
    <tr>
      <td>Item:</td>
      <td>$item</td>
    </tr>
    <tr>
      <td>Inventory:</td>
      <td>$inventory</td>
    </tr>
    <tr>
      <td>Category:</td>
      <td>$category</td>
    </tr>
    <tr>
      <td>Manufacturer:</td>
      <td>$manu</td>
    </tr>
    <tr>
      <td>Model:</td>
      <td>$model</td>
    </tr>
    <tr>
      <td>Condition:</td>
      <td>$condition</td>
    </tr>
    <tr>
      <td>Dimension:</td>
      <td>$dimension</td>
    </tr>
    <tr>
      <td>Description:</td>
      <td>$desc</td>
    </tr>
    <tr>
      <td>Skid Price:</td>
      <td>$skidprice</td>
    </tr>
    <tr>
      <td>Unit Price:</td>
      <td>$unitprice</td>
    </tr>
    <tr>
      <td>Total Price:</td>
      <td>$totalprice</td>
    </tr>
  </table>
			
			
			<b>Images:</b><br>$img1,$img2,$img3,$img4,$img5<br>";
			
	// MAIL SUBJECT
     $subject = "Your All Food Equip Quote";
    // TO MAIL ADDRESS
    $to="$email";
	
	

mail($to, $subject, $msg, $headers);

// Redirect
header("Location: Admin.php?Msg=Sent");

?>

Any suggestions on what needs to be done or an easier way to set up this email temp?

I basically need something like the image below to be sent to clients.

Any help would be greatly appreciated.

You’re using double quotes inside a string in double quotes. You’ll have to escape those double quotes.

I am searching and I cannot find how to do it, Can you give me an example based off my code?

EDIT: I found it, It needs to be like this for example.

<table width=\“700\” border=\“0\” >

I sure appreciate your time.

You must escape the double quotes inside the string:


$msg = 
            "
            
    <b>          <table width=\\"700\\" border=\\"0\\" ></b>
    <tr>
      <td width=\\"119\\">Quote #: </td>
      <td width=\\"208\\">$quote</td>
    </tr>
    <tr>
      <td>Item:</td>
      <td>$item</td>
    </tr>
    <tr>
      <td>Inventory:</td>
      <td>$inventory</td>
    </tr>
    <tr>
      <td>Category:</td>
      <td>$category</td>
    </tr>
    <tr>
      <td>Manufacturer:</td>
      <td>$manu</td>
    </tr>
    <tr>
      <td>Model:</td>
      <td>$model</td>
    </tr>
    <tr>
      <td>Condition:</td>
      <td>$condition</td>
    </tr>
    <tr>
      <td>Dimension:</td>
      <td>$dimension</td>
    </tr>
    <tr>
      <td>Description:</td>
      <td>$desc</td>
    </tr>
    <tr>
      <td>Skid Price:</td>
      <td>$skidprice</td>
    </tr>
    <tr>
      <td>Unit Price:</td>
      <td>$unitprice</td>
    </tr>
    <tr>
      <td>Total Price:</td>
      <td>$totalprice</td>
    </tr>
  </table>
            
            
            <b>Images:</b><br>$img1,$img2,$img3,$img4,$img5<br>"; 

I was able to get the syntex errors all out of the way, but now when I send the form, it is not adding the css.

<?php

	$email = $_POST ['email'];
	$quote = $_POST ['quote'];
	$item = $_POST ['item'];
	$inventory = $_POST ['inventory'];
	$category = $_POST ['category'];
	$manu = $_POST ['manu'];
	$model = $_POST ['model'];
	$condition = $_POST ['condition'];
	$dimension = $_POST ['dimension'];
	$desc = $_POST ['desc'];
	$skidprice = $_POST ['skidprice'];
	$unitprice = $_POST ['unitprice'];
	$totalprice = $_POST ['totalprice'];
	$img1 = $_POST ['img1'];
	$img2 = $_POST ['img2'];
	$img3 = $_POST ['img3'];
	$img4 = $_POST ['img4'];
	$img5 = $_POST ['img5'];
	
	
	
	// contact to database

$connect = mysql_connect("localhost", "DATA-USER", "PASS") or die ("Error , check your server connection.");

mysql_select_db("DATA-NAME");
	

	
	// Always set content-type when sending HTML email
	$headers = "MIME-Version: 1.0" . "\\r\
";
	$headers .= "Content-type:text/html;charset=iso-8859-1" . "\\r\
";

	// More headers
	$headers .= 'From: All Food Equipment<sales@allfoodequip.com>' . "\\r\
";

	$headers .= "Message-ID: <".$now." sales@".$_SERVER['SERVER_NAME'].">\\r\
";
    $headers .= "X-Mailer: PHP v".phpversion()."\\r\
";         
 
	$subject = "Your All Food Equip Quote";
	
	$msg = 
			"	 <html>
<head>
<link href=\\"http://domain.com/quote/style.css\\" rel=\\"stylesheet\\" type=\\"text/css\\" />
</head>

<body>
<div id=\\"container\\">
<div id=\\"header\\"></div>
<!--Closes header-->
<div id=\\"subHead\\"></div>
<!--closes subHead-->
<div class=\\"contents\\">
  <h1>Your All Food Equipment Quote</h1>
  <table width=\\"700\\" border=\\"0\\" class=\\"table\\">
    <tr>
      <td width=\\"119\\">Quote #: </td>
      <td width=\\"208\\">1101</td>
    </tr>
    <tr>
      <td>Item:</td>
      <td>22133</td>
    </tr>
    <tr>
      <td>Inventory:</td>
      <td>Sure</td>
    </tr>
    <tr>
      <td>Category:</td>
      <td>Category</td>
    </tr>
    <tr>
      <td>Manufacturer:</td>
      <td>Big Johnson, LLC.</td>
    </tr>
    <tr>
      <td>Model:</td>
      <td>Refrigerator</td>
    </tr>
    <tr>
      <td>Condition:</td>
      <td>Mint</td>
    </tr>
    <tr>
      <td>Dimension:</td>
      <td>23' x 1&quot;</td>
    </tr>
    <tr>
      <td>Description:</td>
      <td>This is the description box.  This could hold all sorts of stuff</td>
    </tr>
    <tr>
      <td>Skid Price:</td>
      <td>$9.99</td>
    </tr>
    <tr>
      <td>Unit Price:</td>
      <td>$12.99</td>
    </tr>
    <tr>
      <td>Total Price:</td>
      <td>$199.99</td>
    </tr>
  </table>
  <div class=\\"t_middle\\"> <img name=\\"Img\\" src=\\"\\" width=\\"177\\" height=\\"115\\" alt=\\"Img\\" style=\\"background-color: #999999\\" /> <img name=\\"Img\\" src=\\"\\" width=\\"177\\" height=\\"115\\" alt=\\"Img\\" style=\\"background-color: #999999\\" /> <img name=\\"Img\\" src=\\"\\" width=\\"177\\" height=\\"115\\" alt=\\"Img\\" style=\\"background-color: #999999\\" /> <img name=\\"Img\\" src=\\"\\" width=\\"177\\" height=\\"115\\" alt=\\"Img\\" style=\\"background-color: #999999\\" /> <img name=\\"Img\\" src=\\"\\" width=\\"177\\" height=\\"115\\" alt=\\"Img\\" style=\\"background-color: #999999\\" /> </div>
  
  <div class=\\"break\\"><hr /></div><!--break-->
  <!--close t_middle-->
  
  <div class=\\"contactUs\\">
    <p style=\\"color:#650035;\\">How to contact us:</p>
    <ul class=\\"contact_list\\">
      <li>Visit us Online: domain.com</li>
      <li>Contact: MyName</li>
      <li>Direct Line: 123-456-7890</li>
      <li>Email: email@domain.com</li>
    </ul>
    <ul class=\\"contact_list\\">
      <li>Address</li>
      <li>Road</li>
      <li>City, State  zip</li>
      <li>Main Office: 123-456-7890</li>
    </ul>
  </div>
  <p style=\\"font-size:14px;color:#333;\\">TERMS & CONDITIONS: </p>
  <div class=\\"terms\\">
    <p>The following terms and conditions shall be part of any contract of sale, which may be entered into between the Buyer and Sigma Packaging, LLC (Sigma). Any terms and conditions in Buyer\\'s purchase order, acknowledgment or any other writing pertaining to such order, irrespective of it's wording or of when received by Sigma, which are in conflict or inconsistent with or add to the terms and conditions hereof, will not be accepted or become part of any resulting contract without Sigma's express typed or handwritten consent. Neither acknowledgment or return of a copy of Buyer's purchase order or other form, irrespective of it's term, nor the filling and shipment of such order, shall constitute acceptability of such conflicting, inconsistent or additional terms, nor shall they in any way operate to modify or change the full effect of the terms and conditions herein. Unless otherwise agreed upon in writing, the following specific terms and conditions of sale apply to all sales and offers to sell Sigma's product. In the case of rentals, those terms and conditions not expressly covered in the Equipment Rental Agreement are subject to what is written herein. </p>
  </div>
  <!--close terms--> 
</div>
<!--close m_disc-->

<div id=\\"footer\\">
  <ul class=\\"footer_list\\">
    <li><a href=\\"#\\">Home</a></li>
    <li><a href=\\"#\\">New Equipment</a></li>
    <li><a href=\\"#\\">Used Equipment</a></li>
    <li><a href=\\"#\\">Services</a></li>
    <li><a href=\\"#\\">About Us</a></li>
    <li class=\\"last\\"><a href=\\"#\\">Contact Us</a></li>
  </ul>
  <div class=\\"margin_bottom_10\\"></div>
  <span style=\\"color:#FFF;\\">Copyright © 2010 </span> - <a href=\\"#\\"><font color=\\"#FFFFCC\\">All Food Equipment</font></a>
  <div class=\\"margin_bottom_10\\"></div>
  <!-- end of footer --> 
  
</div>
<!--container-->

</body>
</html>
";
			
	// MAIL SUBJECT
     $subject = "Your All Food Equip Quote";
    // TO MAIL ADDRESS
    $to="$email";
	
	

mail($to, $subject, $msg, $headers);

// Redirect
header("Location: Admin.php?Msg=Sent");

?>

Any ideas why it wouldnt be calling the css?

If I remember correctly, to avoid these problems in html emails you have to use inline CSS?

This might be interesting: http://www.campaignmonitor.com/css/