How do I use css to style the email that will be sent from my contact form ? I have tried adding css inline styles to the code but it just breaks it. I would just like to add a message and style the font and add an image/ logo.
<?php
include 'config.php';
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post)
{
<html>
<h1>This is a test email<h1>
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);
$error = '';
</html>
if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
if($mail)
{
echo 'OK';
}
}
}
?>
I would like to add this to the first bit of code so it styles the email that is sent from the contact form.
<span STYLE=\"font-size:20px; color: #333333\"><p>You have recieved a new message enquiry from <a href=\"http://www.google.co.uk\">www.test.co.uk</a> contact form.</p></span>
<p>
<p>
<div STYLE=\"font-size:16px\">
<p><strong>Name:</strong> {$name} </p>
<p><strong>Email Address:</strong> {$email}</strong> </p>
<p><strong>subject:</strong> {$subject} </p>
<p><strong>Message:</strong> {$message} </p>
<h3><p></p></h3>
<div>
<dr />
<span STYLE=\"font-style:italic;font-size:large; color: #333333\">This message was sent from the IP Address: {$ipaddress} on {$date} at {$time}</span></div>
</body>
</html>"