This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > March 2006 > PHP send Email function





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author PHP send Email function
bigj9901

2006-03-28, 6:29 pm

I am using a script that generates an HTML email and sends it via the PHP
mail() function. For some reason I am getting random "!" in my emails. They
don't always appear in the same place. Email also has an embedded stylesheet.
Has anyone else ever experienced this?

Thanks
Jeremy

Boerboel649

2006-03-28, 6:29 pm

We need to see your PHP code in order to really help you out.
bigj9901

2006-03-28, 6:29 pm

Of Course! What was i thinking. Here's a snippet

$action = 'send' ;
$subject = "Dental Mail Order" ;
$mailheaders= "MIME-Version: 1.0\r\n";
$mailheaders.= "Content-type: text/html; charset=ISO-8859-1\r\n";
$mailheaders.= "From: Dental Mail Website <orders@ugotmail.com>";
//$mailheaders.= "Reply-To: $email";

$mailmessage="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>";
$mailmessage.="<html>";
$mailmessage.="<head>";
$mailmessage.="<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>";
$mailmessage.="<title>Untitled Document</title>";
$mailmessage.="<style type='text/css'>";
$mailmessage.="<!--";
$mailmessage.="#frame{";
$mailmessage.="padding:20px;";
$mailmessage.="}";
$mailmessage.="#frame #content {";
$mailmessage.="margin: 0px;";
$mailmessage.="padding: 0px;";
$mailmessage.="background-color:#ffffff;";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="font-size:12px;";
$mailmessage.="}";
$mailmessage.="#frame #content ul{";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="font-size:12px;";
$mailmessage.="}";
$mailmessage.="#frame #content #coup1{";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="font-size:12px;";
$mailmessage.="}";
$mailmessage.="#frame #content #coup2{";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="font-size:12px;";
$mailmessage.="}";
$mailmessage.="#frame #content #address{";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="font-size:12px;";
$mailmessage.="}";
$mailmessage.="#frame #content p, #frame #content h2 {";
$mailmessage.="margin-bottom:0;";
$mailmessage.="padding-bottom:0;";
$mailmessage.="}";
$mailmessage.="#frame #content h2 {";
$mailmessage.="font-family:Arial, Helvetica, sans-serif;";
$mailmessage.="margin-top:40px;";
$mailmessage.="font-weight: bold;";
$mailmessage.="font-size:14px;";
$mailmessage.="color: #990033;";
$mailmessage.="}";
$mailmessage.="-->";
$mailmessage.="</style>";
$mailmessage.="</head>";
$mailmessage.="<body>";
$mailmessage.="<table id='frame' border='0' cellspacing='0' cellpadding='0'>";
$mailmessage.="<tr>";
$mailmessage.="<td>";
$mailmessage.="<table width='100%' border='0' cellspacing='0' cellpadding='0'
id='content'>";
$mailmessage.="<tr>";
$mailmessage.="<td><img
src='http://www.ugotmail.com/dentalMail/_images/emailLogo.gif' width='185'
height='63'></td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Mailer:</strong>&nbsp;".$row_rs_mailer." -
".$row_rs_mailer."</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Name:</strong>&nbsp;".$_SESSION."</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Clinic Name:</strong>&nbsp;".$_SESSION."</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><table width='100%' border='0' cellpadding='0'
cellspacing='0'>";
$mailmessage.="<tr>";
$mailmessage.="<td><table width='100%' border='0' cellspacing='0'
cellpadding='0' id='address'>";
$mailmessage.="<tr>";
$mailmessage.="<td width='16%' valign='top'><strong>Clinic
Address:</strong>&nbsp;</td>";
$mailmessage.="<td>".$_SESSION."<br>".$_SESSION.", ".$_SESSION."
".$_SESSION."</td>";
$mailmessage.="</tr>";
$mailmessage.="</table></td>";
$mailmessage.="</tr>";
$mailmessage.="</table></td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Clinic Phone:</strong>&nbsp;".$_SESSION."</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Clinic Fax:</strong>&nbsp;".$_SESSION."</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td>&nbsp;</td>";
$mailmessage.="</tr>";
$mailmessage.="<tr>";
$mailmessage.="<td><strong>Clinic Toll-Free:</strong>&nbsp;".$_SESSION."</td>";
$mailmessage.="</tr>";

bigj9901

2006-03-28, 6:29 pm

OK I simplified the structure by getting rid of the cluster-f**k of nested tables and that seems to have taken car of the random "!"

Thanks
Jeremy
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews