A quick thanks to The Servant for his assistance on my last problem.
As a quick prelim, I'm a serious novice at this stuff and I'm immersing myself in a website that was built for me, in an attempt to understand and control how everything works.
When someone signs up for a free trial at our site, they receive an email receipt with their shipping info confirmation.
This seems to be just written into our orderpage, as I've made some successful changes to where the email goes, and is from. The code follows.
What I would like to know is if I can add rich text to the email, so I can incorporate images and links and any additional marketing tools I would like to employ.AND, if there is a more effective way of doing this (ie. creating another .html page that is sent as the email; I don't even know if that's possible.
Thoughts, opinions and ideas are greatly appreciated.
-
<?php
-
session_start();
-
include_once("includes/dbConnect.php");
-
include_once("includes/pagerForAll.php");
-
-
require("Sajax.php");
-
-
function mailSiteOwner($products, $customerID)
-
{
-
if($customerID > 0 )
-
{
-
$sqlSelect = "SELECT FirstName, LastName, Email, Phone, Address, City, State, Zip, Amount FROM tbl_user_info WHERE id=".$customerID ;
-
$resSelect = mysql_query($sqlSelect);
-
-
$strFirstName = mysql_result($resSelect, 0, "FirstName");
-
$strLastName = mysql_result($resSelect, 0, "LastName");
-
$strEmailAddr = mysql_result($resSelect, 0, "Email");
-
$strPhoneNums = mysql_result($resSelect, 0, "Phone");
-
$strAddress = mysql_result($resSelect, 0, "Address");
-
$strCity = mysql_result($resSelect, 0, "City");
-
$strState = mysql_result($resSelect, 0, "State");
-
$strZip = mysql_result($resSelect, 0, "Zip");
-
$strAmountPaid = mysql_result($resSelect, 0, "Amount");
-
-
$strHTMLMail = '<table cellspacing="0" cellpadding="5" border="0" bgcolor="#f8f8f8" width="50%" style="font-family:Arial, Helvetica, sans-serif; font-size:12px">
-
<tbody><tr>
-
<th class="formHeader" colspan="2">Client Information </th>
-
</tr>
-
<tr>
-
<td width="49%" align="right">First Name :</td>
-
<td width="51%">
-
<label>'.$strFirstName.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Last Name :</td>
-
<td>
-
<label>'.$strLastName.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Email :</td>
-
<td>
-
<label>'.$strEmailAddr.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Phone Number :</td>
-
<td>
-
<label>'.$strPhoneNums.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Address :</td>
-
<td>
-
<label>'.$strAddress.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">City :</td>
-
<td>
-
<label>'.$strCity.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Zip :</td>
-
<td>
-
<label>'.$strZip.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">State :</td>
-
<td>
-
<label>'.$strState.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Amount Paid :</td>
-
<td>
-
<label>'.$strAmountPaid.'</label>
-
</td>
-
</tr>
-
<tr>
-
<td align="right">Products Interested :</td>
-
<td>
-
<label><b>'.str_replace("::::", "<br />", $products).'</b></label>
-
</td>
-
</tr></tbody></table>';
-
-
$headers = 'MIME-Version: 1.0' . "\r\n";
-
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-
$headers .= 'From: Foosh Energy <trial@trial.com>' . "\r\n";
-
-
$str_mailBody = eregi_replace("[\]",'',$str_mailBody);
-
$boolsendMail = mail("trial@trial.com", "Notification: Mail from Product Section",$strHTMLMail,$headers);
-
-
}
-
else $boolsendMail = false;
-
-
return $boolsendMail;
-
}
-
Thanks,
Andrew