Newer Version Available
lightning:formattedEmail
Displays an email as a hyperlink with the mailto: URL scheme. This component requires API version 41.0 and later.
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@myemail.com" />
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 value="hello@email1.com,hello@email2.com" label="Send a group email" />
3</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 value="hello@myemail.com?cc=cc@myemail.com&subject=My%20subject &body=The%20email%20body"
3 label="Send us your feedback" />
4</aura:component>Attributes
| Attribute Name | Attribute type | Description | Required? |
|---|---|---|---|
| body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | |
| class | String | A CSS class for the outer element, in addition to the component's base classes. | |
| title | String | Displays tooltip text when the mouse moves over the element. | |
| value | String | The email address that's displayed if a label is not provided. | Yes |
| label | String | The text label for the email. | |
| onclick | Action | The action triggered when the email is clicked. |