#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    92
    Rep Power
    13

    include css in mail()


    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?
  2. #2
  3. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    Just stick it in the <head> section.
    And you know I mean that.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    92
    Rep Power
    13
    err...something like this??

    mail($mesg, $subject, $headers...

    part of my css:
    Code:
    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;
    }
    put in part of the message:
    PHP Code:
    $mesg .= "body {";
        
    $mesg .= "background-color: #fffcfc;";
        
    $mesg .= "scrollbar-face-color: #f7eeee;";
        
    $mesg .= "scrollbar-highlight-color: #FFFFFF;";
        
    $mesg .= "scrollbar-shadow-color: #f7eeee;";
        
    $mesg .= "scrollbar-3dlight-color: #F5E9E9;";
        
    $mesg .= "scrollbar-arrow-color:  #800000;";
        
    $mesg .= "scrollbar-track-color: #fbf5f5;";
        
    $mesg .= "scrollbar-darkshadow-color: #cc9999;";
    $mesg .= "}"
    and send it out??
  6. #4
  7. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    As I said before, stick it in <head>
    PHP Code:
    $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; 
    And you know I mean that.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    92
    Rep Power
    13
    i tried u way u show me..but the style still now showing up in my email. wat is wrong?

    is it because the email i sent to got it's own style and my style cannot overwrite the email style...for eg hotmail??
    Last edited by joyce; October 20th, 2002 at 10:40 PM.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    Norway
    Posts
    34
    Rep Power
    13
    I don't think you'll get the scrollbar things (which btw are non-standard) to work in your e-mail prog, since those are meant for IE only. One reason for not using them...
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    USA
    Posts
    830
    Rep Power
    14
    To use HTML/styles in an e-mail it's got to be sent with the appopriate MIME type.

IMN logo majestic logo threadwatch logo seochat tools logo