include css in mail()

They have: 164 posts

Joined: Nov 2001

hi, in my site i got a "tell a friend" section, where user can tell their friends about my site. and then i will send out an email to their friends.

my problem is, i dono how to include css in tat email.

how should i do tat?

He has: 1,016 posts

Joined: May 2002

If you're sending the email as HTML, then why don't you put the CSS inside the HTML?

I.e.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>The Webmaster Forums - Search Results</title>
<style type="text/css">
<!--
a.nav {color: white; font-weight: bold; font-size: 8pt; font-family: verdana, helvetica, sans-serif; text-decoration: none;}
a.nav:hover {color: #cccccc; text-decoration: underline;}

.thtcolor {COLOR: #ffffff}
-->
</style>

<body...
'

They have: 164 posts

Joined: Nov 2001

i try putting it in this way..

$msg=<<<html
<html><head><style>
body {
    background-color: #fffcfc;
    scrollbar-face-color: #f7eeee;
    scrollbar-highlight-color: #FFFFFF;
    scrollbar-shadow-color: #f7eeee;
    scrollbar-3dlight-color: #F5E9E9;
    scrollbar-arrow-color:  #800000;
    scrollbar-track-color: #fbf5f5;
    scrollbar-darkshadow-color: #cc9999;
}
</style></head><body>blah blah</body></html>
html;
$msg.="<table border=0>";
$msg.="<tr><td>blah blah blha</td></tr>";
etc.
'

but dono why my style nv show up.......is it because the email system got it's own style and i'm not able to overwrite it??

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

All you are telling it to do is have a white background and change the scrollbar colour. I don't think you can change the scrollbar colour on email systems, that only works on IE browsers.

Julia - if life was meant to be easy Michael Angelo would have painted the floor....

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

And you should use as well.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.