i am trying to style up my message being sent from the contact form and following is my code i tried to do
$message = echo “< hr>”; but the code didn’t worked kindly let me know how can i style up my following message like change the texts colour, font size (HTML STYLING)
$message="Name : $name \r\n\n";
$message.="PHONE : $phone \r\n\n";
$message.="Company : $company \r\n\n";
$message.="Comments/Questions : \r\n";
$message.="---------------------------------------------------------------------------\r\n";
$message.= $_POST['message'];
To use HTML markup in your email, you need to include an additional header in the
mailfunction:Or, even better, use a library like PHPMailer. That way, you just need to tell it this message is HTML and it will take care of the headers for you.
Edit: forgot to mention, different email clients have very varied CSS support. In general, you should keep the styling to a minimum, test everything in various mail clients, read the helpful articles of people who have already tried… and accept the fact that some mail clients are just a nightmare.