Adding HTML/CSS Styling to PHP

This is where you share YOUR scripts with others

Moderators: egami, macek, gesf

Post Reply
AdoptiveSolution
New php-forum User
New php-forum User
Posts: 163
Joined: Wed Jun 15, 2016 8:35 am

Fri Aug 19, 2016 4:57 am


AdoptiveSolution
New php-forum User
New php-forum User
Posts: 163
Joined: Wed Jun 15, 2016 8:35 am

Fri Aug 19, 2016 6:25 am

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

http://kevinjmcmahon.net/articles/22/ht ... rt-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: Select all

$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.

Post Reply