mail_to (ActionView::Helpers::UrlHelper)

    # File lib/action_view/helpers/url_helper.rb, line 372
          def mail_to(email_address, name = nil, html_options = {})
            html_options = html_options.stringify_keys
            encode = html_options.delete("encode").to_s
            cc, bcc, subject, body = html_options.delete("cc"), html_options.delete("bcc"), html_options.delete("subject"), html_options.delete("body")

            string = ''
            extras = ''
            extras << "cc=#{CGI.escape(cc).gsub("+", "%20")}&" unless cc.nil?
            extras << "bcc=#{CGI.escape(bcc).gsub("+", "%20")}&" unless bcc.nil?
            extras << "body=#{CGI.escape(body).gsub("+", "%20")}&" unless body.nil?
            extras << "subject=#{CGI.escape(subject).gsub("+", "%20")}&" unless subject.nil?
            extras = "?" << extras.gsub!(/&?$/,"") unless extras.empty?

            email_address = email_address.to_s

            email_address_obfuscated = email_address.dup
            email_address_obfuscated.gsub!(/@/, html_options.delete("replace_at")) if html_options.has_key?("replace_at")
            email_address_obfuscated.gsub!(/\./, html_options.delete("replace_dot")) if html_options.has_key?("replace_dot")

            if encode == "javascript"
              tmp = "document.write('#{content_tag("a", name || email_address, html_options.merge({ "href" => "mailto:"+email_address+extras }))}');"
              for i in 0...tmp.length
                string << sprintf("%%%x",tmp[i])
              end
              "<script type=\"#{Mime::JS}\">eval(unescape('#{string}'))</script>"
            elsif encode == "hex"
              email_address_encoded = ''
              email_address_obfuscated.each_byte do |c|
                email_address_encoded << sprintf("&#%d;", c)
              end

              protocol = 'mailto:'
              protocol.each_byte { |c| string << sprintf("&#%d;", c) }

              for i in 0...email_address.length
                if email_address[i,1] =~ /\w/
                  string << sprintf("%%%x",email_address[i])
                else
                  string << email_address[i,1]
                end
              end
              content_tag "a", name || email_address_encoded, html_options.merge({ "href" => "#{string}#{extras}" })
            else
              content_tag "a", name || email_address_obfuscated, html_options.merge({ "href" => "mailto:#{email_address}#{extras}" })
            end
          end