Mail Function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been racking my brain for the better part of a day with a simple mail function. I am trying to generate a list of events from MySQL and then use the php Mail function to email the list in an html email to a mailing list. I keep getting a parse error on a section that I can not figure out why.

The code is attached

Markb
<?php 
require_once('../../Connections/flatfoot.php');
mysql_select_db($database_flatfoot, $flatfoot);
$query_Recordset1 = "SELECT * FROM tblTrnEvent WHERE tblTrnEvent.Sdate BETWEEN '2006-03-02' AND '2006-04-30' AND Etype = 'K' ORDER BY Sdate";
$Recordset1 = mysql_query($query_Recordset1, $flatfoot) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

mail('mbomgardner@xxxxxxxxx','Test Mail Message',
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Up Coming Training</title>
<style type="text/css">
<!--
.title {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 18px;
	color: #FF0000;
	text-decoration: blink;
	letter-spacing: .50em;
	word-spacing: normal;
}
.head {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 16px;
	color: #FF0000;
}
.text {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: normal;
}
.specialtext {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #FF0000;
}
-->
</style>
</head>

<body>
<table width="75%"  border="0">
  <tr>
    <td class="title"><div align="center">Upcoming Training Event </div></td>
  </tr>
  <tr>
    <td class="head"><div align="center">Sponsored by The Kansas Law Enforcement Training Center </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="text"><p>Listed below, you&rsquo;ll find an assortment of Specialized Training classes being offered by the Kansas Law Enforcement Training Center during the months of March and April. Of special interest are the Ethics Instructor class being offered March 13 &ndash; 17; Field Training Officer class being offered March 13 &ndash; 15 in Dodge City; Crime Scene and Arson Photography class offered March 16 &ndash; 17. These classes should have a significant impact on those officers attending, providing new insight and expertise to your agency.</p></td>
  </tr>
  <tr>
    <td class="text">&nbsp;</td>
  </tr>
  <tr>
    <td class="text"><table width="100%"  border="0">
      <tr>
        <td width="15%"><u>Start Date </u></td>
		<td width="15%"><u>Project Number </u></td>
        <td width="35%"><u>Class Title </u></td>
        <td width="34%"><u>Location</u></td>
      </tr>'.
	 do {	 
	  if($row_Recordset1['special'] =='Y'){	  
	  .'<tr class="specialtext">
          <td height="22">'.date("m/d/Y", strtotime($row_Recordset1['Sdate'])).'</td>
		  <td>'.$row_Recordset1['pnumber'].'</td>
          <td>'.$row_Recordset1['title'].'</td>
          <td width="34%">.'$row_Recordset1['city'].'</td>
      </tr>'.
	  
	  }else{
	  .'<tr>
          <td>'.date("m/d/Y", strtotime($row_Recordset1['Sdate'])).'</td>
		  <td>'.$row_Recordset1['pnumber'].'</td>
          <td>'.$row_Recordset1['title'].'</td>
          <td>'.$row_Recordset1['city'].'</td>
      </tr>'.
	  
	  }
      } 
	  
	  while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)).'
	</table></td>
  </tr>
</table>
</body>
</html>
'.mysql_free_result($Recordset1).'')
?>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux