gpc / grails-mail

The Grails Mail Plugin
http://grails.org/plugin/mail
Apache License 2.0
45 stars 85 forks source link

Send HTML mails with external css fails in some mail clients? #14

Closed confile closed 8 years ago

confile commented 11 years ago

When I use the following to send html mails I have a problem when I include css externally in my templates.

sendMail {
  to "john@g2one.com"
  subject "Hello John"
  html render(template:"myMailTemplate")
}

It happens that some mail clients delete the header, i.e., the css. How do you solve this problem? Is inline css the only option? If so it would be very helpful when the plugin compiles an external css file to inline on sending. This would make the html mails more viewable on most mail clients.

sbglasius commented 8 years ago

I believe most email clients does not support external css. You should always inline your css styling, but that is not a job for the mail plugin, thus closing this issue.