Skip navigation
Currently Being Moderated

Safely adding a "mailto:" link to your website

Aug 28, 2012 7:44 AM

Hi,

 

My website has a "Email Me" button that I'm not yet sure of the behavior of. Either it will point straight to a "mailto:", or it will go to a form (that the HTML will specify a target address for).

 

In either case, what would be the safest way to add a target email address so that robots don't automatically pick it up and add it to their "spammable" lists?

 
Replies
  • Currently Being Moderated
    Aug 28, 2012 7:48 AM   in reply to jyeager11

    There is no safe way to use a mailto: link.  Either you use it and take your chances, or you don't use it and be assured that spambots are not able to find your email address.

     

    When I say "don't use it" I mean use another method to send your emails, like server scripting which is totally safe from spambots.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:11 AM   in reply to jyeager11

    Quck and easy?  I dunno.

     

    What kind of server are you hosted on (Windows or *nix)?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:13 AM   in reply to MurraySummers

    Or - go to http://www.bebosoft.com/products/formstogo/overview/ and see if that looks promising.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:33 AM   in reply to jyeager11

    Looks to me like you are on a Linux server, so you could use PHP to process your contact form and send your email.  See if the forms to go thing looks interesting....

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:45 AM   in reply to jyeager11

    "Commercial product"?  PHP is usually free, and if the email address is contained within PHP code, it's invisible to the internet.

     

    ^_^

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:56 AM   in reply to jyeager11

    You could use an email obfuscating javascript. Though, those folks who disable javascript won't see your email link.

     

    I've used this one in the past...

     

    http://www.dynamicdrive.com/emailriddler/

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 9:01 AM   in reply to Jon Fritz II

    Obfuscating JavaScript doesn't work, anymore, from the chatter I've been hearing.  Even the ColdFusion obfuscating CFCs have been surpassed.

     

    ^_^

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 9:20 AM   in reply to jyeager11

    You can do something like this on your page -

     

    <?php echo $success?"<p>Your email has been sent!</p>":''; ?>

    <?php echo $fail?"<p>There has been an error. Your email has not been sent!</p>":''; ?>

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="form1">

    <label for="comments">Comments: </label>

    <textarea name="comments" id="comments"></textarea>

    <input type="submit" name="submit" value="submit">

    </form>

     

    Then at the top of the page put this (above the doctype) -

     

    <?php

    $success = false;

    $fail = false;

    if (array_key_exists('submit', $_POST) {

    $to = 'you@example.com';

    $subject = 'The email subject line';

    $message = $_POST['comments'];

    $headers ="FROM: admin@example.com\r\n";

    $success = mail ($to, $subject, $message, $headers);

    $fail = !$success;

    }

    ?>

     

    Message was edited by: Murray *ACP*

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 9:21 AM   in reply to MurraySummers

    Be aware that this email method is bare bones and is subject to potential email injection, but it works to replace mailto: links.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 9:38 AM   in reply to jyeager11

    First contact your web host and ask them if they have a form-to-email script you can use.  Hosts often provide scripts on their servers which you can activate through your Admin Panel or by referencing the script in your form's action attribute.

     

         <form action="path-to-form-on-server/form-to-email-script.php">

     

    Ideally, you want a form-to-email processing script that:

    a) validates form input fields,

    b) blocks hackers,

    c) stops submissions from spam bots,

    d) hides your email address from harvesters.  

     

    Formm@iler.php from DB Masters script does all of this  and it's free if you credit the author; $20 per domain if you don't.

     

    Related Links:

     

        FormToEmail.com (free & pro versions available)

        http://formtoemail.com/formtoemail_pro_version.php    

     

        Tectite

        http://www.tectite.com/formmailpage.php

     

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 10:26 AM   in reply to Nancy O.

    There are also (old fashioned) cgi scripts that are usually offered by hosting services.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 1:36 PM   in reply to WolfShade

    Perl isn't as robust as PHP.  If that's all you can use, sure.  But if given a choice, PHP is much better.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2013 9:38 AM   in reply to jyeager11

    No offense intended, but the question was about a safe substitute for mailto:, ie, a script that will create a new email in the default email app, drop in an address and subject via a simple text link or button. Is there a JS that will do this while masking the address?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2013 9:56 AM   in reply to customizer2

    So called e-mail address obfuscation methods are not 100% reliable.  If JS is disabled, they don't work.  Also, mailto: links require the end user to have e-mail software installed on their device.  Owing to the increased popularity and accessibility of free web mail services like G-mail, Hotmail, Yahoo mail, etc...  most people don't need e-mail software anymore.  Without software, clicking a mailto: link does absolutely nothing.

     

    For best results, use a contact form with a server-side e-mail processing script.

     

     

    Nancy O.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points