Reputation: 165
I want to send email to my users on certain events, I want the email to be formatted. I mean look like a web page. A few formatting is working like font, bold, but rest like div background color, fieldset etc are not. How to send them?
As we get the promotional mails in our inbox
Upvotes: 1
Views: 1509
Reputation: 884
don't use div tags use only
<table><tr><td> tags
for example
<table>
<tr>
<td style=" background-color:#FF00FF; ">do something </td>
</tr>
</table>
EDIT
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Your Title</title>
</style>
</head>
<body>
<table>
<tr>
<td style="background:url(test.png); width:200px; height:200px;">do something</td>
</tr>
</table>
</body>
</html>
Upvotes: 0
Reputation: 3569
In general - Inline CSS works in most email tools (Outlook, Gmail, . . .) Avoid using STYLE tag. Store IMGes on your site and use their full path.
more tips - http://groundwire.org/labs/email-publishing/using-css-and-html-in-email-newsletters
For more tips you need to show what you tried.
Upvotes: 1
Reputation: 5998
Not all that is supported. To be safe, you should do everything with tables and inline styling. Here's a list of what is and is not supported in various mail clients: http://www.campaignmonitor.com/css/
You could also try starting with a HTML reset template, such as: http://htmlemailboilerplate.com/ which will fix some issues (but of course not add functionality).
Upvotes: 2