What is the best way to style an email message in PHP?

Christopher

New member
I am a newbie at PHP, but have lots of experience in CSS and HTML.

Normally to style text in HTML, I would simply create a class and style accordingly in a separate CSS sheet like this:
(Contents of style.css sheet):
.email_text, .email_text h1 {font: normal italic 12px/12px arial, sans-serif; font-color:blue;}
.email_text h1 {font-size: 14px; font-weight: bold;}

(contents of html):
<div class="email_text">
<h1>This is the subject</h1>
This is the content of the email
</div>

Now, however, I am trying to style an email in PHP and am lost. I have the following in the PHP file:
// MAIL BODY
$message .= $LANG->_('MAIL_HEADER_H1',false);
$message = $LANG->_('HI',false) .' ' . $db->f("name") . ",\n\n";
$message .= $d['mail_content'];

What is the best way to do this? Can I reference a CSS sheet? Do I need to do inline styling? Assume I want the styles given in the CSS style sheet when providing your answer. Thanks!
 
Back
Top