Adding HTML/CSS Styling to PHP

I did some searching and with some trial and error I can use the html below in an email.

http://kevinjmcmahon.net/articles/22/html-and-plain-text-multipart-email-/

I used that text in the sample aboce and included your line of code. I also assumed $name as 'George'.

Also use a <style>. So you have to option to use inline styles or the <style></style> elelment.

Code:
$name = "George";

$email_message .= "
<style>
h2 {color: navy;}
</style>
<h2>Hello,</h2>
<p style='color: green;'>This is a text email, the html version.</p>

<p style='color: #9fbe00; font-size:18px;'><span style='color: red;'>Name</span> : " . $name . "</p>

<p style='color: ed;'>Regards,<br />
Your Name</p>";

Don't forget to use the same text in the plain text version.
 
Back
Top