function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Frank ChenFrank Chen 

How to define CSS in a Visualforce Email Template

Hi, 

 

    I'm working on email templates recent days, and I encounted a problem that I can't import css in a Visualforce Email Template.

 

    The strange thing is that even I paste the code in this article the css code still takes no effect.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_email_templates_stylesheets.htm

 

    Is this usage not supported in new version? Or do I miss some details?  Your help would be appreciated, Thanks.

    

<html>
			<style type="text/css">
			body {font-family: Courier; size: 12pt;}

			table {
			border-width: 5px;
			border-spacing: 5px;
			border-style: dashed;
			border-color: #FF0000;
			background-color: #FFFFFF;
		}

		td {
			border-width: 1px;
			padding: 4px;
			border-style: solid;
			border-color: #000000;
			background-color: #FFEECC;
		}

		th { 
			color: #000000;
			border-width: 1px ;
			padding: 4px ;
			border-style: solid ;
			border-color: #000000;
			background-color: #FFFFF0;
		}
		</style>
		<body>

    

sekharasekhara

<html>
<head>
<style type="text/css">
body {font-family: Courier; size: 12pt;}

table {
border-width: 5px;
border-spacing: 5px;
border-style: dashed;
border-color: #FF0000;
background-color: #FFFFFF;
}

td {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #000000;
background-color: #FFEECC;
}

th {
color: #000000;
border-width: 1px ;
padding: 4px ;
border-style: solid ;
border-color: #000000;
background-color: #FFFFF0;
}
</style>
</head>
<body>

Enter ur data
</body>
</head>

Frank ChenFrank Chen

Hi 

 

Mark RootMark Root
I am having this problem, as well.  The message renders fine in SF but the styles are being commented out in the message that gets sent out.  Why would that be?

Mark.
Omri CohenOmri Cohen
Same here. Did anyone manage to fix this? or understand why it happens?