I am using the following code which is being sent over SMTP. When email message is received in gmail raw html appears. In Outlook the message is blank. What is the issue? A php error or server problem? This is the content I receive in gmail after sending the contact form (outlook email is blank):
<html><body>
<table rules="all" style="border-color: #666;" cellpadding="10" width="100%">
<tr style='background: #eee;'><td width='30%'><strong>Name:</strong> </td><td width='70%'>test</td></tr>
<tr style='background: #eee;'><td><strong>Phone:</strong> </td><td>000-000-0000</td></tr>
<tr style='background: #eee;'><td><strong>Email:</strong> </td><td>testing@provadomarketing.com</td></tr>
<tr style='background: #eee;'><td><strong>Organization:</strong> </td><td>Tester</td></tr>
<tr style='background: #eee;'><td><strong>Address:</strong> </td><td>test st.</td></tr>
<tr style='background: #eee;'><td><strong>Type of Presentation:</strong> </td><td>Keynote Address</td></tr>
<tr style='background: #eee;'><td><strong>Type of Event:</strong> </td><td>Forum</td></tr>
<tr style='background: #eee;'><td><strong>Audience Type:</strong> </td><td><ul>Management</ul></td></tr>
<tr style='background: #eee;'><td><strong>Audience Gender:</strong> </td><td><ul>Female</ul></td></tr>
<tr style='background: #eee;'><td><strong>Event Time Frame:</strong> </td><td>Single Day</td></tr>
<tr style='background: #eee;'><td><strong>Other Speakers:</strong> </td><td>None</td></tr>
<tr style='background: #eee;'><td><strong>A/V Equipment:</strong> </td><td>None</td></tr>
<tr style='background: #eee;'><td><strong>Desired Topics:</strong> </td><td>The book</td></tr>
</table>
</body></html>
<html><body>
<table rules="all" style="border-color: #666;" cellpadding="10" width="100%">
<tr style='background: #eee;'><td width='30%'><strong>Name:</strong> </td><td width='70%'>test</td></tr>
<tr style='background: #eee;'><td><strong>Phone:</strong> </td><td>000-000-0000</td></tr>
<tr style='background: #eee;'><td><strong>Email:</strong> </td><td>testing@provadomarketing.com</td></tr>
<tr style='background: #eee;'><td><strong>Organization:</strong> </td><td>Tester</td></tr>
<tr style='background: #eee;'><td><strong>Address:</strong> </td><td>test st.</td></tr>
<tr style='background: #eee;'><td><strong>Type of Presentation:</strong> </td><td>Keynote Address</td></tr>
<tr style='background: #eee;'><td><strong>Type of Event:</strong> </td><td>Forum</td></tr>
<tr style='background: #eee;'><td><strong>Audience Type:</strong> </td><td><ul>Management</ul></td></tr>
<tr style='background: #eee;'><td><strong>Audience Gender:</strong> </td><td><ul>Female</ul></td></tr>
<tr style='background: #eee;'><td><strong>Event Time Frame:</strong> </td><td>Single Day</td></tr>
<tr style='background: #eee;'><td><strong>Other Speakers:</strong> </td><td>None</td></tr>
<tr style='background: #eee;'><td><strong>A/V Equipment:</strong> </td><td>None</td></tr>
<tr style='background: #eee;'><td><strong>Desired Topics:</strong> </td><td>The book</td></tr>
</table>
</body></html>
process-form.php
Code: [Select]
<!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”>
<style>
body {
background-color: #6BBDB9;
}
div {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
div.mailbody {
font-family: “Courier New”, Courier, mono;
}
div.mailfail {
width: 450px;
border: 3px solid #000000;
padding: 22px 22px 22px 22px;
text-align: center;
vertical-align: middle;
background-color: #FEBA3B;
color: #3F2401;
font-weight: bold;
}
div.mailsent {
width: 450px;
border: 3px solid #000000;
padding: 22px 22px 22px 22px;
text-align: center;
vertical-align: middle;
background-color: #FF900B;
color: #000000;
font-weight: bold;
}
</style>
<title><?php echo($title); ?></title>
<?php
require (“smtpclass.php”);
if($_SERVER[“REQUEST_METHOD”] == “POST”)
{
$smtp=new SMTPMAIL;
$stemail = “test@gmail.com”; //EMAIL TO RECIEVE THE PRESENTATION BOOKINGS
$stsubject = “Contact from Website”; //THE SUBJECT OF THE EMAIL
$stfrom = “do-not-send@website.com”; //THE ‘From:’ EMAIL ADDRESS
$stwho= “website”; //NAME TO APPEAR ON THE EMAIL
$streply= “do-no-reply@website.com”; //THE REPLY-TO ADDRESS
$cc=””;
if(!$_POST[‘fullname’]) {
header(“Location: index.html”);
}
$headers = “From: ” .$stwho. ”<”.$stfrom. ”>n” . “Reply-To: ” .$streply. ”n”;
$headers .= ‘MIME-Version: 1.0’ . ”rn”;
$headers .= ‘Content-type: text/html; charset=iso-8859–1’ . ”rn”;
// message
$message = ””;
$artype = array(
“keynote” => “Keynote Address”,
“seminar” => “Seminar”,
“workforce” => “Workforce Development”,
“training” => “Leadership / Staff Training”
);
$arevent = array(
“forum” => “Forum”,
“formal” => “Formal Address”,
“informal” => “Informal Address – Audience Interaction”,
“discussion” => “Discussion”,
“solving” => “Problem Solving”
);
$audtype = ””;
if($_POST[‘professional’]) { $audtype.=“Professional”; }
if($_POST[‘management’]) { $audtype.=“Management”; }
if($_POST[‘employees’]) { $audtype.=“Employees”; }
if($_POST[‘youth’]) { $audtype.=“Youth”; }
$audgend = ””;
if($_POST[‘male’]) { $audgend.=“Male”; }
if($_POST[‘female’]) { $audgend.=“Female”; }
if($_POST[‘coed’]) { $audgend = “Co-ed”; }
$ftimeframe = “Multi Day”;
if($_POST[‘timeframe’] == ‘single’) {
$ftimeframe = “Single Day”;
}
$fotherspeakers = “None”;
if($_POST[‘otherspeakers’] == ‘yes’) {
$fotherspeakers = strip_tags($_POST[‘whospeakers’]);
}
$avequip = “None”;
if($_POST[‘equip’] == ‘yes’) {
$avequip = strip_tags($_POST[‘yesequip’]);
}
$artopics = array(
“book” => “The book”,
“leadership” => “Leadership & Management”,
“communication” => “Communication”,
“planning” => “Planning”,
“skills” => “Presentation Skills”,
“contracts” => “Government Contracts”
);
$message .= ”<html><body>”;
$message .= ”n<table rules=“all” style=“border-color: #666;\” cellpadding=\“10\” width=\“100%\”>”;
$message .= ”n<tr style=‘background: #eee;’><td width=‘30%’><strong>Name:</strong> </td><td width=‘70%’>” . strip_tags($_POST[‘fullname’]) . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Phone:</strong> </td><td>” . strip_tags($_POST[‘phone’]) . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Email:</strong> </td><td>” . strip_tags($_POST[‘email’]) . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Organization:</strong> </td><td>” . strip_tags($_POST[‘organization’]) . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Address:</strong> </td><td>” . strip_tags($_POST[‘address’]) . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Type of Presentation:</strong> </td><td>”;
if($_POST[‘type’] == “other”) {
$message .= strip_tags($_POST[‘typeother’]) . ”</td></tr>”;
} else {
$message .= $artype[$_POST[‘type’]] . ”</td></tr>”;
}
$message .= ”n<tr style=‘background: #eee;’><td><strong>Type of Event:</strong> </td><td>” . $arevent[$_POST[‘event’]] . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Audience Type:</strong> </td><td><ul>” . $audtype . ”</ul></td></tr>”;
if($_POST[‘youth’]) {
$message .= ”n<tr style=‘background: #eee;’><td><strong>Youth Age Group:</strong> </td><td>” . strip_tags($_POST[‘youthother’]) . ”</td></tr>”;
}
$message .= ”n<tr style=‘background: #eee;’><td><strong>Audience Gender:</strong> </td><td><ul>” . $audgend . ”</ul></td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Event Time Frame:</strong> </td><td>” . $ftimeframe . ”</td></tr>”;
if($_POST[‘timeframe’] == ‘multi’) {
$message .= ”n<tr style=‘background: #eee;’><td><strong>Days:</strong> </td><td>” . strip_tags($_POST[‘multidays’]) . ”</td></tr>”;
}
$message .= ”n<tr style=‘background: #eee;’><td><strong>Other Speakers:</strong> </td><td>” . $fotherspeakers . ”</td></tr>”;
if($fotherspeakers != ‘None’) {
$message .= ”n<tr style=‘background: #eee;’><td><strong>Speakers Topics:</strong> </td><td>” . strip_tags($_POST[‘speakerstopics’]) . ”</td></tr>”;
}
$message .= ”n<tr style=‘background: #eee;’><td><strong>A/V Equipment:</strong> </td><td>” . $avequip . ”</td></tr>”;
$message .= ”n<tr style=‘background: #eee;’><td><strong>Desired Topics:</strong> </td><td>”;
if($_POST[‘topics’] == “other”) {
$message .= strip_tags($_POST[‘topicsother’]) . ”</td></tr>”;
} else {
$message .= $artopics[$_POST[‘topics’]] . ”</td></tr>”;
}
$message .= ”n</table>”;
$message .= ”n</body></html>”;
if(!$smtp->send_smtp_mail($stemail,$stsubject,$message,$headers,$cc,$stfrom))
$error=“Error in sending the following message please directly email contact@website.com: ”.$smtp->error;
else
$report=“The following message was sent successfully!”;
}
?>
<?php @extract($_POST);?>
</head>
<body>
<center><div class=“mailsent”><?php echo $report; echo $error; ?>:<br /><br />
<div class=“mailbody”><?php echo($message); ?></div><br /><br />
<a href=“javascript:history.go(-1);”>Go Back</a>
</div></center>
</body>
</html>