Results 1 to 1 of 1

Thread: How to cloak e-mail address

  1. #1
    Join Date
    Dec 2008
    Posts
    22

    ThumbsUp How to cloak e-mail address

    Many spiders or robots are designed for address-harvesting i.e, to extract email addresses from web pages for spam fuel. They scan web pages and harvest any strings that have the format username@domain.com(or .ext).

    In order to hide your email address or protect it from these bots you can use simple Javascript code:
    <script language="JavaScript">
    <!--
    emailname = "username"
    emailserver = "domain.ext"
    document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
    document.write(emailname + "@" + emailserver);
    document.write("</a>");
    -->
    </script>

    Place this snippet of code directly into the HTML copy, at the point where you want the email link. For example, if your email address is lookundertable@yahoo.com, your script would look like

    <script language="JavaScript">
    <!--
    emailname = "lookundertable"
    emailserver = "yahoo.com"
    document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
    document.write(emailname + "@" + emailserver);
    document.write("</a>");
    -->
    </script>

    The line of code (document.write(emailname + "@" + emailserver) determines what the link should say. If you want it to display "Wanna send me mail -- bingo!" then it would read document.write("Wanna send me mail -- bingo!"); You simply place the desired text in quotes between the parentheses. The way the line is scripted above, the link merely displays the email address itself. No matter what you set for the display, the email address will never show itself to spam harvesters.

    You can also create a Javascript function to use in pages where your email address appears multiple times. The page has to be saved as an ASP page.

    Paste the following code in the heading section (after <head> and before </head>).

    <script language="JavaScript" RUNAT=SERVER>
    <!--
    function cloakml2 ( emailname, emailserver, text)
    {
    if (text == "") text = emailname + "@" + emailserver
    return "<a href='mailto:" + emailname + "@" + emailserver +"'>" + text + "</a>";
    }
    -->
    </script>

    You can call the function in various ways:

    ==========================

    example 1:

    <p>My address is
    <%
    Response.write (cloakml2("lookundertable","yahoo.com", ""))
    %>.</p>

    Looks like

    My address is lookundertable@yahoo.com.

    ==========================

    example 2:

    <p>My name is
    <%
    Response.write (cloakml2("lookundertable","yahoo.com", "Swirky-Mirky"))
    %> and you can contact me!</p>

    Looks like

    My name is Swirky-Mirky and you can contact me!



    Be sure to save the page with an ASP extension.


    Hope you use it.....
    Last edited by Quack; 26-12-2008 at 08:47 PM.

Similar Threads

  1. Cloak design in Journey game
    By Speedy $inghs in forum Video Games
    Replies: 6
    Last Post: 23-03-2012, 09:07 PM
  2. Replies: 3
    Last Post: 22-02-2012, 05:26 PM
  3. How to modify icloud mail address
    By Gowri in forum Technology & Internet
    Replies: 3
    Last Post: 21-06-2011, 12:08 AM
  4. Someone has same e-mail address as me
    By teena19 in forum Technology & Internet
    Replies: 2
    Last Post: 13-08-2009, 10:56 AM
  5. address book in windows mail
    By SocialAbility in forum Windows Vista Mail
    Replies: 3
    Last Post: 23-10-2007, 01:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,721,669,199.20428 seconds with 17 queries