php email send script emailing codes along with email conten
Posted: Sun Aug 29, 2010 6:57 am
Hello,
I hope someone can help. I am not proficient in php or much of html!
The contact form on my website sends the emails with the form contents via php script. However, when I tried to change the email address, I must have changed something and now the form contents include the php script codes.
I will post both the php script and the email content here. I have tried looking up on internet but nothing makes much sense to me!!
Thanks!!!
mail_send.php
<?php
ob_start();
session_start();
if(isset($_POST['enter']) && $_POST['enter']==1)
{
$_SESSION['fname']=$_POST['fname'];
$_SESSION['email']=$_POST['email'];
$to="meritinternational@rogers.com";
$subject='Contact Form';
$message= "<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style>";
$message.="<table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>".$_POST['fname']."</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>".$_POST['lname']."</td></tr>
<tr><td class=textstyle>E-mail address: </td> <td class=textstyle>".$_POST['email']."</td></tr>
<tr><td class=textstyle>Comment: </td> <td class=textstyle>".$_POST['comment']."</td></tr>
</table>";
$mail_from = "From:meritinternational@rogers.com";
$mail_from .="rnContent-type: text/html";
@mail($to,$subject,$message,$mail_from);
header("location: contactthanks.html");
exit();
}
?>
EMAIL that I receive when someone fills the contact form on the website-
<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style><table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>Brett Babb</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>Brett Babb</td></tr>
<tr><td class=textstyle>E-mail address: </td> <td class=textstyle>backyjack6@gmail.com</td></tr>
<tr><td class=textstyle>Comment: </td> <td class=textstyle>Do you wish you could increase your online leads? We have helped a lot of businesses thrive in this market and we can help you! Simply hit reply and I’ll share with you the cost and the benefits.
</td></tr>
</table>
I hope someone can help. I am not proficient in php or much of html!
The contact form on my website sends the emails with the form contents via php script. However, when I tried to change the email address, I must have changed something and now the form contents include the php script codes.
I will post both the php script and the email content here. I have tried looking up on internet but nothing makes much sense to me!!
Thanks!!!
mail_send.php
<?php
ob_start();
session_start();
if(isset($_POST['enter']) && $_POST['enter']==1)
{
$_SESSION['fname']=$_POST['fname'];
$_SESSION['email']=$_POST['email'];
$to="meritinternational@rogers.com";
$subject='Contact Form';
$message= "<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style>";
$message.="<table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>".$_POST['fname']."</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>".$_POST['lname']."</td></tr>
<tr><td class=textstyle>E-mail address: </td> <td class=textstyle>".$_POST['email']."</td></tr>
<tr><td class=textstyle>Comment: </td> <td class=textstyle>".$_POST['comment']."</td></tr>
</table>";
$mail_from = "From:meritinternational@rogers.com";
$mail_from .="rnContent-type: text/html";
@mail($to,$subject,$message,$mail_from);
header("location: contactthanks.html");
exit();
}
?>
EMAIL that I receive when someone fills the contact form on the website-
<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style><table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>Brett Babb</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>Brett Babb</td></tr>
<tr><td class=textstyle>E-mail address: </td> <td class=textstyle>backyjack6@gmail.com</td></tr>
<tr><td class=textstyle>Comment: </td> <td class=textstyle>Do you wish you could increase your online leads? We have helped a lot of businesses thrive in this market and we can help you! Simply hit reply and I’ll share with you the cost and the benefits.
</td></tr>
</table>