Hi All,
I have a form in which users input text into 5 textareas. I want this form then emailed to me as a HTML page.
The form is standard html, my processor script is process.php as shown below:
<?php
$to = "123@songs.net";
$name = $HTTP_POST_VARS['name'];
$from = $HTTP_POST_VARS['email'];
$subject = "Poetry Submission";
$Song = $HTTP_POST_VARS['Song'];
$Writer = $HTTP_POST_VARS['Writer'];
$main = $HTTP_POST_VARS['main'];
$versea = $HTTP_POST_VARS['versea'];
$verseb = $HTTP_POST_VARS['verseb'];
$versec = $HTTP_POST_VARS['versec'];
$versed = $HTTP_POST_VARS['versed'];
// check the user has input a correct address
if(ereg("(.+)@(.+)\.(.+)$",$to))
{
}else{
echo("You must supply a valid (TO) address<br>");
echo("<script>alert(\"Error:Click Here To Go Back\");history.go(-1)</script>");
exit;
}
if(ereg("(.+)@(.+)\.(.+)$",$from))
{
}else{
echo("You must supply a valid (FROM) address<br>");
echo("<script>alert(\"Error:Click To Here Go Back\");history.go(-1)</script>");
exit;
}
// formats the headers section DO NOT ALTER OR MAKE ANY CHANGES
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// Appends the copyright notice to the bottom of the message
// DO NOT ALTER OR MAKE ANY CHANGES
$message .="<HTML><HEAD><TITLE>Poetry Plus: ()</TITLE><META NAME='distribution' CONTENT='Global'><META NAME='//////resource-type' CONTENT='document'<META NAME='generator' CONTENT='Dreamweaver'><link rel='Stylesheet' href='http://www.poetry.net:80/lyrics.css' type='text/css'><script src='http://www.poetry.net:80/inc-jscript.php'
type='text/javascript' language='Javascript'><!-- //--></script></HEAD><BODY BGCOLOR='#FFFFFF' TEXT='#000000' LINK='#0000FF' ALINK='#333333' VLINK='#9900CC' ONLOAD='self.focus();'><div align=center><p><table width='100%' border=0 cellspacing=1 cellpadding=3 class='border'><tr><td align=left class='header' colspan=2><b>POETRY LYRICS: '.$Song.' Lyrics: '.$Lyrics.'</b></td></tr><tr><td width='5%' align=right valign=top class='content'>main</td><td width='95%' align=left valign=top class='content'>$main</td></tr><tr><td width='5%' align=right valign=top class='content' nowrap>verse 1</td><td width='95%' align=left valign=top class='content'>$versea</td></tr><tr><td width='5%' align=right valign=top class='content' nowrap>verse 2</td><td width='95%' align=left valign=top class='content'>$verseb</td></tr><tr><td width='5%' align=right valign=top class='content' nowrap>verse 3</td><td width='95%' align=left valign=top class='content'>$versec</td></tr><tr><td width='5%' align=right valign=top class='content' nowrap>verse 4</td><td width='95%' align=left valign=top class='content'>$versed</td></tr></table><p><div></body></html>";
// formats the input and sends the email
@$send=mail($to,$subject,$message,$headers);
// prints success or failure to the user
if($send==1){
echo("<html><head><title>SUCCESS...Email Sent</title></head><body>");
echo("<center><h2>Success....</h2><br><p>Your email has been sent<br>");
echo("Thank You for using PHP Mailer v1.0<br>");
echo("Click here to send another email<br>");
echo("<a href=\"form.php\">PHPMAILER</a></p></center>");
echo("</body></html>");
}else{
echo("<html><head><title>FAILURE...Email Not Sent</title></head><body>");
echo("<center><h2>Sorry....</h2><br><p>There appears to have been a problem<br>");
echo("in processing your email<br>Please try again later...<br>");
echo("<a href=\"form.php\">PHPMAILER</a><br>");
echo("Thank You for using PHP Mailer v1.0</p></center>");
echo("</body></html>");
}
// finally everything OK, exit the script
exit();
?>
End code.
The variables get into the html section $versea etc ok.
But i just receive the email as html code not as a displayed html page.
Can any one help?
Thanks