Skip to content

View Helpers

mailTo()

mailTo() — returns string

Available in: controller Category: Link Functions

Creates a mailto link tag to the specified email address, which is also used as the name of the link unless name is specified.

NameTypeRequiredDefaultDescription
emailAddressstringyesThe email address to link to.
namestringnoA string to use as the link text (“Joe” or “Support Department”, for example).
encodeanynotrueWhen set to true, encodes tag content, attribute values, and URLs so that Cross Site Scripting (XSS) attacks can be prevented. Set to attributes to only encode attribute values and not tag content.
#mailTo(emailAddress="webmaster@yourdomain.com", name="Contact our Webmaster")#
<!--- Outputs: <a href="mailto:webmaster@yourdomain.com">Contact our Webmaster</a> --->