0

Hi I am using Mailer to send email to a customer when they purchase an item. The email sends with all details included but the css styling is not recognised. If I "open the html page with" google chrome the styling is fine.

_Layout.cshtml page:

<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="email-styles.css" rel="stylesheet" /> 
</head>
<body>
<div id="wrapper">

        <div id="head">
            <div id="logo"><img src="../../Content/images/email/logo.jpg" /></div>
            <div id="date">@ViewBag.DateNow</div>
            </div>
</div>
user2993038
  • 35
  • 1
  • 2
  • 6

1 Answers1

2

You have to use inline stylings for html emails. Gmail in particular will not recognize CSS stylesheets and will strip them out. I personally haven't tried this tool but its from mailchimp so give that a go and see if your email works correctly.

http://beaker.mailchimp.com/inline-css

  • Html Email are a real pain. Here is another link for you to try http://mashable.com/2013/11/08/email-responsive-design/. This is never an easy job and requires a lot of debugging and testing. I think I'll make a note of the above link myself though, mailchimp is awesome. – The Humble Rat Dec 10 '13 at 16:31
  • Thanks all, ya learning the hard way...inline styling works but is different on 2 different email providers I have used.. – user2993038 Dec 10 '13 at 17:14
  • Would like to use a template but I need to link to sql database and not so sure if it can be done with templates. – user2993038 Dec 10 '13 at 18:07