smsohan / MvcMailer

A Mailer for ASP.Net MVC that forms the Email Body using MVC Views (Razor etc.) following Ruby on Rails ActionMailer style
MIT License
582 stars 178 forks source link

Css file #101

Open mihaitibrea opened 11 years ago

mihaitibrea commented 11 years ago

Hello, I tried to insert a css file to my mail instead of writing all the css at the end of the cshtml page.

The name of the css is Mail.css and it's in the folder Content/Mail.css i tried using

@Styles.Render("~/Content/css").

And also, in the css file, I am using a small image to display. It is not displayed in the email. background: url("../Images/image.png") no-repeat;

Can you help me in some way ?

Mastanka commented 9 years ago

Was anoyone lucky with solving this problem?

mihaitibrea commented 9 years ago

You cannot add external style sheets to an email, all css has to be inside the page.

Mastanka commented 9 years ago

Ou... And did you find solution how to transform stylesheet reference such ass: @Styles.Render("~/Content/css") to transforming it to include css styles directly into html elements inside email?

mihaitibrea commented 9 years ago

http://lmgtfy.com/?q=+inline+css+online