Formatted Email

lightning:formattedEmail

Displays an email as a hyperlink with the mailto: URL scheme. This component requires API version 41.0 and later.

For Aura components only. For LWC development, use lightning-formatted-email.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline

A lightning:formattedEmail component displays a read-only representation of an email address as a hyperlink using the mailto: URL scheme. Clicking on the email address opens the default mail application for the desktop or mobile device.

This example displays an email address with an email icon. The email address is displayed as the default label.

1<aura:component>
2  <lightning:formattedEmail value="hello@example.com" />
3</aura:component>

This example prevents the display of the email icon.

1<aura:component>
2  <lightning:formattedEmail value="hello@example.com" hideIcon="true" />
3</aura:component>

Multiple email addresses are supported. The label “Send a group email” is displayed as a hyperlink in this example.

1<aura:component>
2  <lightning:formattedEmail
3    value="email@example.com,hello@example.com"
4    label="Send a group email"
5  />
6</aura:component>

This example creates an email address with values for cc, subject, and email body. The label is displayed as a hyperlink.

1<aura:component>
2  <lightning:formattedEmail
3    value="hello@example.com?cc=email@example.com&subject=My%20subject &body=The%20email%20body"
4    label="Send us your feedback"
5  />
6</aura:component>

Attributes 

NameDescriptionTypeDefaultRequired
bodyThe body of the component. In markup, this is everything in the body of the tag.Aura.Component[]
hideIconIf true, hides the email icon so only the email address is displayed.Boolean
labelThe text label for the email.String
onclickThe action triggered when the email is clicked.Aura.Action
valueThe email address that's displayed if a label is not provided.String