Form Email Output styling
Posted: Mon Jul 14, 2014 4:21 am
I have created a html form which i inserted into my webpage and have done a php file to send me the details entered into the from via email however,
i don't receive a email
and
i would like to receive the results with html formatting.
I have looked everywhere to try find a solution but did not find one.
Could someone please help please i am really really stuck.
Thank You
My HTML code
i don't receive a email
and
i would like to receive the results with html formatting.
I have looked everywhere to try find a solution but did not find one.
Could someone please help please i am really really stuck.
Thank You
My HTML code
Code: Select all
<form method="post" action="/form/php/sendresults.php">
<label>First Name: <input type="text" name="firstname" size="30" maxlength="30" />
</label>
<label>Last Name: <input type="text" name="lastname" size="30" maxlength="30" />
</label>
<textarea name="comments" rows="8" cols="50" style="margin-left:37px" />
</textarea>
<input type="submit" value="submit" />
</form>Code: Select all
<?php
$to = 'info@my.com';
$subject = $firstname;
$message = '
<html>
<head>
<title>'.$firstname.'</title>
</head>
<body>
<p>'.$firstname.'!</p>
<table>
<tr>
<th>Full Name</th><th>Company Name</th><th>Company Registered Number</th><th>Phone Number</th>
</tr>
<tr>
<td>'.$lastname.'</td><td>'.$comments.'</td><td>'.$firstname.'</td><td>'.$firstname.'</td>
</tr>
</table>
</body>
</html>
';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
?>