Smart Mailer PHP Support Product Page

This topic was archived

Dynamic File

Asked 11 May 2005 20:12:24
1
has this question
11 May 2005 20:12:24 Jeff Montgomery posted:
I am not sure how I can add a HTML to the body of the email dynamically. I have a category table, newslettermember table and a file table.

Category
----------
CategoryKey
category

NewsletterMembers
---------------------
NewletterKey
CategoryKey
Email
Name

NewsletterHTML
-----------------
NesletterHTMLKey
CategoryKey
HTMLfile

* the HTMLfile is the name of the file but the actual file is located on the server ../HTMLfile/

I can use this SQL to get the info I need:
SELECT
`category`.`Category`,
`newslettermembers`.`Name`,
`newslettermembers`.`Email`,
`newsletterhtml`.`HTMLFile`
FROM
`category`
INNER JOIN `newslettermembers` ON (`category`.`CategoryKey` = `newslettermembers`.`CategoryKey`)
INNER JOIN `newsletterhtml` ON (`newslettermembers`.`CategoryKey` = `newsletterhtml`.`CategoryKey`)
WHERE
(`category`.`CategoryKey` = colname)

colname = categorykey

This gives me

Category Name of person emailaddress of person and the file name


Thanks for the help

Replies

Replied 13 May 2005 17:54:42
13 May 2005 17:54:42 Jeff Montgomery replied:
ok no response. Is there another way to do this?
Replied 24 Feb 2007 03:35:15
24 Feb 2007 03:35:15 Mat p replied:
I to are having the same trouble. is there a solution. after spending good money you would think there would be someone from design team answering questions. Please help.
Replied 26 Feb 2007 17:48:44
26 Feb 2007 17:48:44 Georgi Kralev replied:
Hi Jeff,

1. Select Template option from the Content page of Smart Mailer dialog window.
2. Browse one of your HTML files.
3. Check the following line: $sm1->setBody_Template_html
As parameter of the method should be send the string containing the file that you have browsed.
4. Delete from the string the filename (leave only the path) And concatenate to it the value for the HTMLFile from your database:
For example the resulting line could look like this:

$sm1->setBody_Template_html("../HTMLfile/".$row_Recordset1['HTMLFile']);

I hope this help you.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 20 Mar 2007 13:21:55
20 Mar 2007 13:21:55 Mat p replied:
i to have a problem with this. i have already created a newsletter with this and worked. i am now creating one that emails only on person at a time. my problem is i get there name email from 1 recordset and the data entered in another, it emails but no content show.
i have tried the following

SELECT `form`.userID, `form`.added_by, `form`.email, price.ID, price.added_by, price.price_from, price.price_to, price.comments
FROM `form`
INNER JOIN price
ON `form`.userID = price.ID
Replied 20 Mar 2007 16:07:24
20 Mar 2007 16:07:24 Georgi Kralev replied:
Hi Mat p,

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>my problem is i get there name email from 1 recordset and the data entered in another, it emails but no content show <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

It looks like the problem is with your sql statement. Which column from the select statement contains the emails content?

Before using Smart Mailer PHP make sure that your select statement is correct and emails content column contains the required value.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 21 Mar 2007 01:13:55
21 Mar 2007 01:13:55 Mat p replied:

These are the details i want to show on each reply by single email "price.added_by, price.price_from, price.price_to, price.comments", but i want to then have the results match and be displayed for each user ID, at the moment all it is doing is sending the last data entered into the database. SELECT * FROM price ORDER BY ID DESC


Replied 21 Mar 2007 12:15:02
21 Mar 2007 12:15:02 Georgi Kralev replied:
If I understand you right you want to include the following values in your emails: "price.added_by, price.price_from, price.price_to, price.comments".

How this will be done depend on the type of Body that you use:
1. For example if you use Template:
Your template should be php and you will have to pass the values from your record as URL parameters.
And in your template you will have to _GET the values and generate the email text.

2. The other option is to be used Static text/html and in the body string to be added dynamically your values.

I hope this helps you.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 22 Mar 2007 01:27:22
22 Mar 2007 01:27:22 Mat p replied:
here is the 3 forms im using to process and to send the email, i have the info entering the database but no emails is sent

<pre id=code><font face=courier size=2 id=code>
-----------------page 1 start-----------------
if (!function_exists("GetSQLValueString") {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string" ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_conn_fra, $conn_fra);
$query_Recordset2 = "SELECT * FROM price ORDER BY ID DESC";
$Recordset2 = mysql_query($query_Recordset2, $conn_fra) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);

$colname_Recordset1 = "-1";
if (isset($_GET['userID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['userID'] : addslashes($_GET['userID']);
}
mysql_select_db($database_conn_fra, $conn_fra);
$query_Recordset1 = sprintf("SELECT * FROM `form` WHERE userID = %s", GetSQLValueString($colname_Recordset1, "int");
$Recordset1 = mysql_query($query_Recordset1, $conn_fra) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

// Buzz inet PHPLS03 - Check User Session is set
session_start();
if(!isset($HTTP_SESSION_VARS['usersession'])){
header("Location: ../login.php";
////// Logout Section. Delete all session variable.
session_destroy();

$message="";
}
?&gt;&lt;?php
$cust_name = htmlentities($_POST['userID']);
?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;&lt;!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" --&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;!-- InstanceBeginEditable name="doctitle" --&gt;
&lt;title&gt;Administration&lt;/title&gt;
&lt;!-- InstanceEndEditable --&gt;
&lt;!-- InstanceBeginEditable name="head" --&gt;&lt;!-- InstanceEndEditable --&gt;
&lt;link href="../css.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="20" border="0" align="center" cellpadding="3" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table width="100" border="0" align="center" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="91"&gt;&lt;img src="images/logo.gif" width="600" height="127" /&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;table width="781" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td colspan="5"&gt;&lt;div align="right" class="BlueWhiteHeader"&gt;AGENT ADMINISTRATION &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt; &lt;/td&gt;
&lt;td width="668" class="text"&gt;Hello &lt;strong&gt;&lt;? echo $_SESSION['usersession']; ?&gt;! &lt;/strong&gt;You are now Logged in. &lt;/td&gt;
&lt;td class="text"&gt;&lt;div align="right"&gt;&lt;a href="../default.php" class="textLink"&gt;Logout&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="81" valign="top"&gt;&lt;a href="default.php" class="textLink"&gt;Home&lt;/a&gt;&lt;/td&gt;
&lt;td width="10"&gt; &lt;/td&gt;
&lt;td colspan="2"&gt;&lt;!-- InstanceBeginEditable name="body" --&gt;
&lt;p class="text"&gt; &lt;/p&gt;
&lt;form name="form1" id="form1" method="get" action="reply_2.php"&gt;
&lt;p&gt;&lt;span class="text"&gt;&lt;strong&gt;Lead response - Step 1 of 1 to Lead ID:&lt;?php echo $row_Recordset1['userID']; ?&gt; / &lt;?php echo $row_Recordset1['added_by']; ?&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table align="center" bgcolor="#C6DBF2" class="text"&gt;
&lt;tr valign="baseline"&gt;
&lt;td nowrap align="right"&gt;&lt;strong&gt;Price from:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type="text" name="price_from" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="baseline"&gt;
&lt;td nowrap align="right"&gt;&lt;strong&gt;Price to:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type="text" name="price_to" size="32"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="baseline"&gt;
&lt;td nowrap align="right" valign="top"&gt;&lt;strong&gt;Comments:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;textarea name="comments" cols="50" rows="5" id="comomments"&gt;&lt;/textarea&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="baseline"&gt;
&lt;td nowrap align="right"&gt; &lt;/td&gt;
&lt;td&gt;&lt;input type="submit" value="Send E-mail --&gt;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;input type="hidden" name="userID" value=""&gt;
&lt;input name="added_by" type="hidden" id="added_by" value="&lt;?php echo $row_Recordset1['added_by']; ?&gt;" /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;/form&gt;

----------------------page 1 end---------------------

---------------------page 2 start----------------------
&lt;?php
// Buzz inet PHPLS03 - Check User Session is set
session_start();
if(!isset($HTTP_SESSION_VARS['usersession'])){
header("Location: ../login.php";
////// Logout Section. Delete all session variable.
session_destroy();

$message="";
}
?&gt;
&lt;?php require_once('../Connections/conn_fra.php'); ?&gt;
&lt;?php require_once('../ScriptLibrary/incSmartMailer.php'); ?&gt;
&lt;?php
if (!function_exists("GetSQLValueString") {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string" ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1") {
$insertSQL = sprintf("INSERT INTO price (added_by, price_from, price_to, comments, `datetime`) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['added_by'], "text",
GetSQLValueString($_POST['price_from'], "text",
GetSQLValueString($_POST['price_to'], "text",
GetSQLValueString($_POST['comments'], "text",
GetSQLValueString($_POST['datetime'], "text");

mysql_select_db($database_conn_fra, $conn_fra);
$Result1 = mysql_query($insertSQL, $conn_fra) or die(mysql_error());

$insertGoTo = "reply_3.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

$colname_Recordset1 = "-1";
if (isset($_GET['userID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['userID'] : addslashes($_GET['userID']);
}
mysql_select_db($database_conn_fra, $conn_fra);
$query_Recordset1 = sprintf("SELECT * FROM `form` WHERE userID = %s", GetSQLValueString($colname_Recordset1, "int");
$Recordset1 = mysql_query($query_Recordset1, $conn_fra) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

mysql_select_db($database_conn_fra, $conn_fra);
$query_Recordset2 = "SELECT * FROM price ORDER BY ID DESC";
$Recordset2 = mysql_query($query_Recordset2, $conn_fra) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?&gt;
&lt;?php
// Smart Mailer 1.0.3
// Send on submit of form form1
if (count($HTTP_POST_VARS) &gt; 0) {
@set_time_limit(300);
$sm1 = new SmartMailer();
$sm1-&gt;checkVersion("1.03";
$sm1-&gt;smtpSetup("localhost", "21", "user", "pw";
$sm1-&gt;component = "Sendmail";
$sm1-&gt;tmpFolder = "../temp";
$sm1-&gt;embedImages = true;
$sm1-&gt;progressBar = "";
$sm1-&gt;ignore_errors = true;
$sm1-&gt;setFrom("Topic", " );
$sm1-&gt;setTo($row_Recordset1['added_by'], $row_Recordset1['email']);
$sm1-&gt;setCc("", "";
$sm1-&gt;setBcc("", "";
$sm1-&gt;setSubject("".$row_Recordset1['added_by'].", Your Free Real Estate Appraisal";
// using template for body
$sm1-&gt;setBody_Template_html("../response/appraisal.php";
// Attachments none
$sm1-&gt;sendMail("one";
$GoTo = "reply_3.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$GoTo .= (strpos($GoTo, '?')) ? "&" : "?";
$GoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $GoTo));
}
$SM_mailAction = getMailAction();
?&gt;
&lt;?php
$cust_name = htmlentities($_POST['ID']);
$cust_name = htmlentities($_POST['added_by']);
$cust_name = htmlentities($_POST['price_from']);
$cust_name = htmlentities($_POST['price_to']);
$cust_name = htmlentities($_POST['comments']);
$cust_name = htmlentities($_POST['datetime']);
?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;&lt;!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" --&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;!-- InstanceBeginEditable name="doctitle" --&gt;
&lt;title&gt;Administration&lt;/title&gt;
&lt;!-- InstanceEndEditable --&gt;
&lt;!-- InstanceBeginEditable name="head" --&gt;
&lt;script type="text/JavaScript"&gt;
&lt;!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//--&gt;
&lt;/script&gt;
&lt;!-- InstanceEndEditable --&gt;
&lt;link href="../css.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="20" border="0" align="center" cellpadding="3" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table width="100" border="0" align="center" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="91"&gt;&lt;img src="images/logo.gif" width="600" height="127" /&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;table width="781" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td colspan="5"&gt;&lt;div align="right" class="BlueWhiteHeader"&gt;AGENT ADMINISTRATION &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt; &lt;/td&gt;
&lt;td width="668" class="text"&gt;Hello &lt;strong&gt;&lt;? echo $_SESSION['usersession']; ?&gt;! &lt;/strong&gt;You are now Logged in. &lt;/td&gt;
&lt;td class="text"&gt;&lt;div align="right"&gt;&lt;a href="../default.php" class="textLink"&gt;Logout&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="81" valign="top"&gt;&lt;a href="default.php" class="textLink"&gt;Home&lt;/a&gt;&lt;/td&gt;
&lt;td width="10"&gt; &lt;/td&gt;
&lt;td colspan="2"&gt;&lt;!-- InstanceBeginEditable name="body" --&gt;
&lt;p class="text"&gt;&lt;strong&gt;Lead response - Step 2 of 2 &lt;/strong&gt;&lt;/p&gt;
&lt;form action="&lt;?php echo $SM_mailAction?&gt;" name="form1" method="post"&gt;
&lt;span class="text"&gt; &lt;/span&gt;
&lt;p class="text"&gt;Price From: &lt;?php echo $price_from ?&gt;&lt;br /&gt;
Price To: &lt;?php echo $price_to ?&gt;&lt;/p&gt;
&lt;p class="text"&gt;Comments: &lt;?php echo $comments ?&gt;&lt;/p&gt;
&lt;p&gt;
&lt;input type="hidden" name="added_by" value="&lt;?php echo $added_by ?&gt;" /&gt;
&lt;input type="hidden" name="comments" value="&lt;?php echo $comments ?&gt;" /&gt;
&lt;input type="hidden" name="price_from" value="&lt;?php echo $price_from ?&gt;" /&gt;
&lt;input type="hidden" name="price_to" value="&lt;?php echo $price_to ?&gt;" /&gt;
&lt;input type="hidden" name="datetime" value="&lt;?php echo $datetime ?&gt;" /&gt;
&lt;input type="submit" name="Submit" value="Send Email --&gt;" /&gt;
&lt;input type="hidden" name="MM_insert" value="form1"&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class="textLink" onclick="MM_openBrWindow('view_reply.php?&added_by=&lt;?php echo $added_by ?&gt;&price_from=&lt;?php echo $price_from ?&gt;&price_to=&lt;?php echo $price_from ?&gt;&comments=&lt;?php echo $comments ?&gt;"','','scrollbars=yes,width=565,height=650')"&gt;&lt;a href="#"&gt;View Email &lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;/form&gt;
&lt;!-- InstanceEndEditable --&gt;&lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt; &lt;/td&gt;
&lt;td colspan="2"&gt; &lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2" bgcolor="#EEEEEE"&gt;&lt;div align="center" class="text"&gt;© Free Realestate Appraisals 2007 &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;!-- InstanceEnd --&gt;&lt;/html&gt;
&lt;?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);
?&gt;

---------------page 2 end--------------------
---------------page 3 start ----------------

</font id=code></pre id=code>&lt;?php
// Buzz inet PHPLS03 - Check User Session is set
session_start();
if(!isset($HTTP_SESSION_VARS['usersession'])){
header("Location: ../login.php";
}
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;&lt;!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" --&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;!-- InstanceBeginEditable name="doctitle" --&gt;
&lt;title&gt;Administration&lt;/title&gt;
&lt;!-- InstanceEndEditable --&gt;
&lt;!-- InstanceBeginEditable name="head" --&gt;&lt;!-- InstanceEndEditable --&gt;
&lt;link href="../css.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="20" border="0" align="center" cellpadding="3" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table width="100" border="0" align="center" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="91"&gt;&lt;img src="images/logo.gif" width="600" height="127" /&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;table width="781" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td colspan="5"&gt;&lt;div align="right" class="BlueWhiteHeader"&gt;AGENT ADMINISTRATION &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt; &lt;/td&gt;
&lt;td width="668" class="text"&gt;Hello &lt;strong&gt;&lt;? echo $_SESSION['usersession']; ?&gt;! &lt;/strong&gt;You are now Logged in. &lt;/td&gt;
&lt;td class="text"&gt;&lt;div align="right"&gt;&lt;a href="../default.php" class="textLink"&gt;Logout&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="22"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="81" valign="top"&gt;&lt;a href="default.php" class="textLink"&gt;Home&lt;/a&gt;&lt;/td&gt;
&lt;td width="10"&gt; &lt;/td&gt;
&lt;td colspan="2"&gt;&lt;!-- InstanceBeginEditable name="body" --&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class="text"&gt;&lt;strong&gt;Your response has been sent . &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="text"&gt;&lt;a href="default.php"&gt;&lt;span class="textLink"&gt;Click here&lt;/span&gt;&lt;/a&gt; when complete. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;

---------------page 3 end ------------------------

---------------email template start -----------
&lt;?php require_once('../Connections/conn_fra.php'); ?&gt;
&lt;?php
if (!function_exists("GetSQLValueString") {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string" ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_conn_fra, $conn_fra);
$query_Recordset1 = "SELECT * FROM price ORDER BY ID DESC";
$Recordset1 = mysql_query($query_Recordset1, $conn_fra) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table width="789" border="0" align="center" cellpadding="3" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&lt;img src="../images/banner_img.jpg" width="800" height="335" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&lt;p align="left" class="style1"&gt;Dear &lt;?php echo $row_Recordset1['added_by']; ?&gt;&lt;br /&gt;
&lt;br /&gt;

My job is to provide you with information specifically for your property from the information you have provided to me. I have researched the area and the market conditions, comparable sales and combined this with my local knowledge of the area. In my opinion I believe your property is worth approximately $&lt;?php echo $row_Recordset1['price_from']; ?&gt; to $&lt;?php echo $row_Recordset1['price_to']; ?&gt;.&lt;/p&gt;
&lt;p align="left" class="style1"&gt;Thank you for the opportunity to provide this free service to you.&lt;/p&gt;
&lt;? if ($row_Recordset1['comments'] != "" { ?&gt;
&lt;p align="left" class="style1"&gt;Comments: &lt;?php echo $row_Recordset1['comments']; ?&gt;&lt;/p&gt;
&lt;? } ?&gt;
&gt;
&lt;p class="style1"&gt;&lt;br /&gt;
**Print off a copy for your records**&lt;/p&gt;
&lt;p class="style1"&gt; &lt;/p&gt;
&lt;p class="style1"&gt;DISCLAIMER&lt;br /&gt;
T
&lt;p&gt; &lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;/td&gt;
&lt;td&gt;&lt;div align="center"&gt;------Do not reply to this email------&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php
mysql_free_result($Recordset1);
?&gt;
---------------end----------------------
[/code]


Edited by - snarzom on 25 Mar 2007 05:48:51

Reply to this topic