# CSS inside email



## cpscdave (Feb 25, 2004)

Anyone have any experience with this? 
I've tried leaving a css link tag but that didn't work in all the email clients we tried.
I also tried embeding the CSS in the area but again no luck.

Any ideas? I dont really want to go back thru and hard code all the style into the body


----------



## tomdkat (May 6, 2006)

Did the link refer to some website somewhere? If so, that will be problematic since some e-mail clients will block loading of content hosted on external servers. Spammers do that a LOT which is why e-mail clients block loading remote content. Malicious e-mail also uses this technique.

Embedding the CSS is your best bet.

Peace...


----------



## tomdkat (May 6, 2006)

Does the link refer to some website somewhere? If so, that will be problematic since some e-mail clients will block loading things from remote sites. Spam and malicious e-mail messages sometimes do this which is why remote site access is blocked.

Either embed the CSS or have the e-mail message contain a link to a web page where the browser can fully render the page.

Peace...


----------



## cpscdave (Feb 25, 2004)

I've tried both ways.
First had it referering to an external site (where the images are hosted) but that of course didnt work, So then tried replacing the link with the css inside of a


----------



## tomdkat (May 6, 2006)

When you send a message with the CSS embedded in the section, have you looked at the source of the message as received by the e-mail client to see what happened to the HTML message you sent?

Peace...


----------



## cpscdave (Feb 25, 2004)

Odd it looks like the webmail is actually changing the source.
For example the template has: 

```
<img src="http://spamooze.com/mailer_img/Newsletter_Header.jpg" alt="SpamOoze Newsletter" width="612" height="120" />
```
when you look at the source in Outlook you get the same.

When you look at the source in the webmail (zimbra) you get:


```
<img alt="SpamOoze Newsletter" width="612" height="120" dfsrc="http://spamooze.com/mailer_img/Newsletter_Header.jpg">
```
Which just doesn't work when I pop it back into dreamweaver... 
Any idea's on how to tighten this up so that it works??


----------



## tomdkat (May 6, 2006)

Looks like security against HTML email. The src tag was changed to "dfsrc", which is why the image won't load. What happens to the SAME message if you view it using Outlook Express or Mozilla Thunderbird?

Peace...


----------



## cpscdave (Feb 25, 2004)

Yeah it looks fine when I connect with Outlook to the webmail server... 
Guess if its a security thing there really isn't anything we can do about it. 

I was thinking there was a problem with how I had built the html (html isn't my forte)


----------



## tomdkat (May 6, 2006)

Wow, ok. If it works in Outlook and not in the webmail client, you can expect the same kind of "randomness" with others you send you mail to. Maybe you should restructure the format of your HTML mail so you won't need to use CSS styling.

I'm not really a HTML e-mail person so I'm not sure what the best course of action would be.

Peace...


----------



## sarahknz (May 6, 2003)

I've got a fancy chart of which email clients let you use what markup.

Once you've waded through it you become resigned to using * rather than tidy css.*


----------



## tomdkat (May 6, 2006)

Thanks for the info! 

Peace...


----------

