jamietre / CsQuery

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4.
Other
1.16k stars 250 forks source link

Add feature to copy styles inline for HTML emails #130

Closed ejsmith closed 11 years ago

ejsmith commented 11 years ago

A common issue with HTML emails is that you can't rely on using a style block in your HTML because a lot of email clients will remove it. So you end up having to take all of your styles and repeat them over and over in the HTML. It would be great if we could use CsQuery to do this for us. There is a similar project called PreMailer.Net that uses Fizzler and HtmlAgilityPack to do this.

cdonges commented 11 years ago

I would use that. :) On 29/08/2013 11:33 AM, "Eric J. Smith" notifications@github.com wrote:

A common issue with HTML emails is that you can't rely on using a style block in your HTML because a lot of email clients will remove it. So you end up having to take all of your styles and repeat them over and over in the HTML. It would be great if we could use CsQuery to do this for us. There is a similar project called PreMailer.Net that uses Fizzler and HtmlAgilityPack to do this.

— Reply to this email directly or view it on GitHubhttps://github.com/jamietre/CsQuery/issues/130 .

jamietre commented 11 years ago

This sounds like something you could use CsQuery as a tool to help write, but it seems like an end use rather than something that would be a part of the core library.

ejsmith commented 11 years ago

I would probably agree with that. I went ahead and ported the PreMailer.Net library to use CsQuery. You can view the code here: https://github.com/codesmithtools/PreMailer.Net