mail_to has several methods for hindering email harvestors and customizing
the email itself by passing special keys to +html_options+.
==== Options
*
encode - This key will accept the strings "javascript" or "hex".
Passing "javascript" will dynamically create and encode the mailto: link then
eval it into the DOM of the page. This method will not show the link on
the page if the user has JavaScript disabled. Passing "hex" will hex
encode the +email_address+ before outputting the mailto: link.
*
replace_at - When the link +name+ isn't provided, the
+email_address+ is used for the link label. You can use this option to
obfuscate the +email_address+ by substituting the @ sign with the string
given as the value.
*
replace_dot - When the link +name+ isn't provided, the
+email_address+ is used for the link label. You can use this option to
obfuscate the +email_address+ by substituting the . in the email with the
string given as the value.
*
subject - Preset the subject line of the email.
*
body - Preset the body of the email.
*
cc - Carbon Copy addition recipients on the email.
*
bcc - Blind Carbon Copy additional recipients on the email.
==== Examples
mailTo("
[email protected]")
# =>
[email protected]
mailTo("
[email protected]", "My email", array('encode' => "javascript"))
# =>
mailTo("
[email protected]", "My email", array('encode' => "hex"))
# =>
My email
mailTo("
[email protected]", null, array('replaceAt' => "_at_", 'replaceDot' => "_dot_", 'class' => "email"))
# =>
me_at_domain_dot_com
mailTo("
[email protected]", "My email", array('cc' => "
[email protected]",
'subject' => "This is an example email"))
# =>
My email