fuel/fuel/core/classes/html.php
public static function mail_to_safe($email, $text = null, $subject = null, $attr = array())
	{
		$text or $text = str_replace('@', '[at]', $email);

		$email = explode("@", $email);

		$subject and $subject = '?subject='.$subject;

		$attr = array_to_attr($attr);
		$attr = ($attr == '' ? '' : ' ').$attr;

		$output = '<script type="text/javascript">';
		$output .= '(function() {';
		$output .= 'var user = "'.$email[0].'";';
		$output .= 'var at = "@";';
		$output .= 'var server = "'.$email[1].'";';
		$output .= "document.write('<a href=\"' + 'mail' + 'to:' + user + at + server + '$subject\"$attr>$text</a>');";
		$output .= '})();';
		$output .= '</script>';
		return $output;
	}
public static function mail_to_safe($email, $text = null, $subject = null, $attr = array())
	{
		$text or $text = str_replace('@', '[at]', $email);

		$email = explode("@", $email);

		$subject and $subject = '?subject='.$subject;

		$attr = array_to_attr($attr);
		$attr = ($attr == '' ? '' : ' ').$attr;

		$output = '<script type="text/javascript">';
		$output .= '(function() {';
		$output .= 'var user = "'.$email[0].'";';
		$output .= 'var at = "@";';
		$output .= 'var server = "'.$email[1].'";';
		$output .= "document.write('<a href=\"' + 'mail' + 'to:' + user + at + server + '$subject\"$attr>$text</a>');";
		$output .= '})();';
		$output .= '</script>';
		return $output;
	}
public static function mail_to_safe ( $ email , $ text = null , $ subject = null , $ attr = array ( ) ) { $ text or $ text = str_replace ( '@' , '[at]' , $ email ) ; $ email = explode ( "@" , $ email ) ; $ subject and $ subject = '?subject=' . $ subject ; $ attr = array_to_attr ( $ attr ) ; $ attr = ( $ attr == '' ? '' : ' ' ) . $ attr ; $ output = '<script type="text/javascript">' ; $ output .= '(function() {' ; $ output .= 'var user = "' . $ email [ 0 ] . '";' ; $ output .= 'var at = "@";' ; $ output .= 'var server = "' . $ email [ 1 ] . '";' ; $ output .= "document.write('<a href=\"' + 'mail' + 'to:' + user + at + server + '$subject\"$attr>$text</a>');" ; $ output .= '})();' ; $ output .= '</script>' ; return $ output ; }
Creates a mailto link with Javascript to prevent bots from picking up the
email address.

@param	string	the email address
@param	string	the text value
@param	string	the subject
@param	array	attributes for the tag
@return	string	the javascript code containg email
Creates a mailto link with Javascript to prevent bots from picking up the email address .