Question

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>
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top