Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Help with protecting my e-mail adress from spam

  1. #1
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Help with protecting my e-mail adress from spam

    Hello!

    I've implemented a small JavaScript on my webpage that is supposed to protect my e-mail adress from e-mail harvesters and mailbots. I followed directions to the letter in how to add it to my webpages, but when I look at the webpage in a browser window, I'm seeing a new e-mail link in the top left corner of the page.

    Can someone help, perhaps?

    Here's the JavaScript code:

    Code:
    <script language="JavaScript"><!--
    var name = "info";
    var domain = "froso.dk";
    document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
    document.write(name + '@' + domain + '</a>');
    // --></script>
    And here's the footer on my webpage:

    Code:
    <!-- Footer Start -->
    <div id="footer">
       	Fr&oslash;s&oslash; K&oslash;kkenfornyelse &middot; Oldenvej 7 &middot; 3490 Kvistg&aring;rd<br/>
      Tlf.: 4917 7728 &middot; Fax: 4917 7738 &middot; E-mail: <a href="removed for security" class="footerlink">removed for security</a></div>
    <!-- Footer End -->
    I've tried testing with removing the JavaScript above, and that seems to remove the odd link in the top left corner. Why does it get created?

    PS: Also, I've noticed that whenever I click on the 'mailto:' e-mail link, the browser opens a new 'blank' window before proceeding to open a new mail in my mail software (in my case, Microsoft Outlook).

    How do I change that so that the new pop-up window doesn't appear?


    Cheers,
    Bassa
    Last edited by jscheuer1; 03-11-2009 at 02:55 PM. Reason: removed email address for security

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    try:
    Code:
    <!-- Footer Start -->
    <div id="footer">
       	Fr&oslash;s&oslash; K&oslash;kkenfornyelse &middot; Oldenvej 7 &middot; 3490 Kvistg&aring;rd<br/>
      Tlf.: 4917 7728 &middot; Fax: 4917 7738 &middot; E-mail: <a href="#" class="footerlink" id="jse">removed for security</a></div>
    <script type="text/javascript">
    var name="info";
    var domain="froso.dk";
    document.getElementById("jse").href=name+"@"+domain;
    </script>
    <!-- Footer End -->
    Last edited by jscheuer1; 03-11-2009 at 02:53 PM. Reason: removed email address for security
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  3. #3
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Doesn't appear to work.

    The e-mail now links to: http://www.froso.dk/test/removed for security.

    Changing the 'href' to correct path: removed for security changes nothing, apparently.


    Cheers,
    Bassa
    Last edited by jscheuer1; 03-11-2009 at 02:52 PM. Reason: removed email address for security

  4. #4
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    have you tried this?
    Code:
    <!-- Footer Start -->
    <div id="footer">
       	Fr&oslash;s&oslash; K&oslash;kkenfornyelse &middot; Oldenvej 7 &middot; 3490 Kvistg&aring;rd<br/>
      Tlf.: 4917 7728 &middot; Fax: 4917 7738 &middot; E-mail: <a href="#" class="footerlink" id="jse">info@froso.dk</a></div>
    <script type="text/javascript">
    var name="info";
    var domain="froso.dk";
    document.getElementById("jse").href="mailto: "+name+"@"+domain;
    </script>
    <!-- Footer End -->
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  5. #5
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    That worked, but it's still showing the mail-link in the top left corner.

    Here's the webpage: http://www.froso.dk/test/index.html


    Cheers,
    Bassa

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Um, that's not the right script. Of course it will display in the upper corner: that's where it document.write()s it to. Use the DOM-based ones the other people in this thread have suggested.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Cool. Is it possible to have the mail adress just look like: info (at) froso.dk?

    Right now, it reads: mailto:info (at) froso.dk in the browser.


    Cheers,
    Bassa

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If you mean what I think you mean, then no, the mailto: construct is an equivalent of http:: it tells the browser what to do with that string, and without it the URI is meaningless.

    The best solution, of course, is to use a server-side mailing script, so that your address need never be exposed to the world at all. What you've got at the moment is still quite vulnerable to harvesting, and also blocks non-Javascript users from using the mailto link directly.

    The existence of all those &oslash;es and &middot;s in your HTML would seem to indicate an encoding problem — you should be able to enter ø and · directly in any properly–set-up environment.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    If you mean what I think you mean, then no, the mailto: construct is an equivalent of http:: it tells the browser what to do with that string, and without it the URI is meaningless.
    Alright.

    Quote Originally Posted by Twey View Post
    The best solution, of course, is to use a server-side mailing script, so that your address need never be exposed to the world at all. What you've got at the moment is still quite vulnerable to harvesting, and also blocks non-Javascript users from using the mailto link directly.
    Good to know. Do you know of an alternative, and preferably better, solution?

    Quote Originally Posted by Twey View Post
    The existence of all those &oslash;es and &middot;s in your HTML would seem to indicate an encoding problem — you should be able to enter ø and · directly in any properly–set-up environment.
    Yes. I created another thread some weeks ago where I questionened whether it was necessary for me to "convert" these Dreamweaver automated changes myself.

    Dreamweaver changes the letter 'Ø' into &oslash; by default.

    I'm confident that my environment is just fine as it is, and I'm fairly sure that I'll change all these Dreamweaver changes back unto their original form, ie. Æ, Ø and Å.

    Thank you!


    Cheers,
    Bassa

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Note: Whatever you do to protect an email address that has already been compromised, spammers will still have it because these lists of harvested email addresses are constantly exchanged among spammers. However, once an address is protected, over time spam emails should gradually decrease, because these list eventually go out of date and/or are updated with data believed to be accurate as to the viability of the addresses they contain. Responding to any spam email you receive, even if only to opt out, only serves to confirm your email address on these lists.

    While a server side solution is preferable for at least two important reasons:

    1. If properly setup, it cannot be hacked to get the address.
    2. It allows people without an email client configured to still email you without doing anything extra.


    If a server side solution is not readily available, one may use my:

    http://home.comcast.net/~ansiguy/emailen1.htm

    Once encrypted, most spam bots will not be able to tell that it is an email link, however even those without javascript enabled will be able to email you easily if they have an email client configured. And, with or without an email client configured or without javascript enabled, most will be able to right click and copy the address for use with their third party email host (like hotmail, gmail, etc.).

    The reason this works is that although all modern browsers will automatically 'decrypt' the address, most bots - though they easily could, won't bother because they won't know it's anything that they are looking for in the first place. No javascript is required, because it uses only tokens and entities which the browser may render as ordinary characters without the aid of javascript.

    The encryptor itself requires that you have javascript enabled to use it though.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •