---
schema_version: "1"
id: 86ca057734535b066f5a15d3c504491fac00eda51834400ff3fb6c29b307bcb1
title: messaging:htmlEmailBody
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/components/pages-compref-messaging-htmlemailbody.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-messaging-htmlemailbody.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e8b36d8ddf1a36f9d4249aa965855b2bb252c0d80f93f88ac2cb0e202826d81d
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# messaging:htmlEmailBody

The HTML version of the email body.

## Example

```apex
<messaging:emailTemplate recipientType="Contact"
	relatedToType="Account"
	subject="Case report for Account: {!relatedTo.name}"
	replyTo="support@acme.com">
		<messaging:htmlEmailBody>
		<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>
            <p>Dear {!recipient.name},</p>
            <p>Below is a list of cases related to {!relatedTo.name}.</p>
            <table border="0" >
            	<tr>
            	<th>Case Number</th><th>Origin</th>
            	<th>Creator Email</th><th>Status</th>
            </tr>
            <apex:repeat var="cx" value="{!relatedTo.Cases}">
            	<tr>
            		<td><a href = 
            			"https://na1.salesforce.com/{!cx.id}">{!cx.CaseNumber}
            		</a></td>
            		<td>{!cx.Origin}</td>
            		<td>{!cx.Contact.email}</td>
            		<td>{!cx.Status}</td>
            	</tr>
            </apex:repeat> 
            </table>
            <p/>
            <center>
            	<apex:outputLink value="https://salesforce.com">
            	For more detailed information login to Salesforce.com
            </apex:outputLink>
            </center>
            
		</body>
		</html>
	</messaging:htmlEmailBody>
</messaging:emailTemplate>
```

## Attributes

|Attribute Name|Attribute Type|Description|Required?|API Version|Access|
|--------------|--------------|-----------|---------|-----------|------|
|`id`|String|An identifier that allows the htmlEmailBody component to be referenced by other components in the page.| |14.0|global|
|`rendered`|Boolean|A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true.| |14.0|global|

**See Also**  


-   [Visualforce Email Templates](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/email-and-templates/pages-email-templates-intro.md)

