Anatoliy  Gusarov
Anatoliy Gusarov

Reputation: 808

Can I detect outlook client and change styles of my html email?

I am composing html email.

I know from here:http://www.campaignmonitor.com/css/#css-com_1 that Outlook does not support background color but other clients does. I have nice green bg image and white text on it. But in outlook I see nothing - white text on white background with no background image.

Can I detect email client, and if it is Outlook, then change color style of my text from white to black, for example?

Things could be simplified, if I could render image with text and put image only, but I have to put links in text. Yes, I can use map/area, but this doesn't work on several important web email clients (freemail.ukr.net for me).

Upvotes: 1

Views: 3735

Answers (2)

John
John

Reputation: 12193

Yes you can target only Outlook using conditional CSS statements

But a better approach is to get it to actually work in Outlook. In html email it is best to declare your background color in a table like this:

<table bgcolor="#007700">...

Needs to be the 6-digit hex code for full client support.

For background images, check out emailbg.net for the only method where you can set a background image to a page element. (There is another non-VML way to do it that only works in the body tag)

Upvotes: 2

rileychuggins
rileychuggins

Reputation: 79

Email client communications with the email-server does not work the same way as browser communication does. So this can't be done.

You're best bet would be to link to a webpage at the very top of the page. Something that says Can't View This Email? Click Here to view it in your browser.

Upvotes: -1

Related Questions