Computer Science Canada

html not rendering in email

Author:  tupac [ Sun Jul 19, 2009 11:19 pm ]
Post subject:  html not rendering in email

So I'm trying to send a newsletter using html code for rendering and making everything look readable, but when I send it out, the text is the html text (not rendered). I am using very little CSS code (just styling tables and body), the layout is done with tables. I read that email doesn't like divs for layout.
My code looks something like this:
Quote:

<html>
<head>
<link rel="stylesheet" type="text/css" href="screen.css">
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="580" border="0" cellspacing="0" cellpadding="0"><tr><td>Something here</td><td>And Here</td></tr></table>
</tr>
</table>

</body>
</html>

*this is not the actual newsletter, it's just an example of what I use for styling.

Author:  Brightguy [ Sun Jul 19, 2009 11:33 pm ]
Post subject:  Re: html not rendering in email

The content-type should be text/html, not text/plain.

Author:  gianni [ Mon Jul 20, 2009 9:20 am ]
Post subject:  RE:html not rendering in email

You need to ensure that you're actually sending a multipart email. A multipart email is exactly what it sounds like: one can include multiple versions of an email with different mime-types. I would recommend sending both a text and html version to ensure you reach the broadest audience. You'll have to check the docs for whatever software you're using to find out how to specify multipart emails.

Also, don't forget to use absolute paths for your resources (e.g. CSS, images, &c...).


: