You have to use well-formatted html with INLINE styles.
With the help from the interwebs :
http://www.google.com/search?q=php+send+formatted+mail
Found this :
https://css-tricks.com/sending-nice-htm ... -with-php/
http://www.tutorialrepublic.com/php-tut ... -email.php
Adding HTML/CSS Styling to PHP
Moderators: egami, macek, gesf
-
- php-forum Super User
- Posts: 197
- Joined: Wed Jun 15, 2016 8:35 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.
Don't forget to use the same text in the plain text version.
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>";