---
schema_version: "1"
id: 9a58e48863bb5243719ed791678029b2258ba57fb221ccab49568426651c4b03
title: Visualforce Email Templates
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/email-and-templates/pages-email-templates-intro.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-email-templates-intro.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8691e9fc3bb7a0ffba505c628a893e17df8ef9faba9a378a937d6b92d8352725
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Visualforce Email Templates

Developers and administrators can use Visualforce to create email templates. The advantage of using Visualforce over standard HTML email templates is that Visualforce gives you the ability to perform advanced operations on data that is sent to a recipient.

Although Visualforce email templates use standard Visualforce components, they are not created in the same way. Visualforce email templates always use components that are prefaced with the `messaging` namespace. In addition, these topics provide more details.

-   All Visualforce email templates must be contained within a single `<messaging:emailTemplate>` tag. This is analogous to regular Visualforce pages being defined within a single `<apex:page>` tag.
-   The `<messaging:emailTemplate>` tag must contain either a single `<messaging:htmlEmailBody>` tag or a single `<messaging:plainTextEmailBody>` tag.
-   Several standard Visualforce components are not available for use within `<messaging:emailTemplate>`. These include `<apex:detail>`, `<apex:pageBlock>` and all related `pageBlock` components, and all input components such as `<apex:form>`. If you attempt to save a Visualforce email template with these components, an error message displays.

-   [Create a Visualforce Email Template](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-email-templates-creating.md)
-   [Use a Custom Stylesheet in a Visualforce Email Template](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-email-templates-stylesheets.md)
-   [Add Attachments to a Visualforce Email Template](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-email-templates-attachments.md)
-   [Using Custom Controllers within Visualforce Email Templates](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-email-templates-with-apex.md)

