Skip to main content
Inspiring
Sep 25, 2018 1:00 AM UTC
Answered

How are most of you adding 'mailto' links these days?

I don't code on the regular anymore, and need to add a simple "click here to contact" button (png) on a page. Wasn't sure how developers were protecting their addresses from easy harvesting in 2018, or if they were even still bothering anymore. (Are they?)

I'd be open to anything that doesn't require more than regular ul/dl ftp access to the web server.

Thanks.

    This topic is closed to new replies. Start a new post to keep the conversation going.
    BenPleysier
    BenPleysierCorrect answer
    Community Expert
    Sep 25, 2018 2:19 AM UTC

    The easy solution https://andrew.hedges.name/experiments/obfuscator/

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!

    23 replies

    Under S.Author
    Inspiring
    Nov 21, 2018 3:18 AM UTC

    The simplest form I could find to implement is this one : Tryit Editor v3.5 - Show PHP

    Despite having only superficial knowledge of PHP variables + includes, if that does what it looks like it does, then it's pretty much what I need (down to the error msg handling) + I think I can handle implementing and customizing it. But that can't be all of it, can it? Pardon my ignorance, but why can't I see where it sends the form (or how obfuscated or not that destination is)?

    Thx!

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Nov 21, 2018 5:36 PM UTC

    https://forums.adobe.com/people/Under+S.  wrote

    The simplest form I could find to implement is this one : Tryit Editor v3.5 - Show PHP

    Simple is right.  It doesn't do anything.  It's merely an example of PHP form field validation & sanitizing. 

    I already posted a contact form above.  Have you tried it yet?

    Contact form issue and question.

    Translate
    Nancy O'Shea— Product User & Community Expert
    Under S.Author
    Inspiring
    Nov 22, 2018 4:35 AM UTC

    https://forums.adobe.com/people/Nancy+OShea  wrote

    https://forums.adobe.com/people/Under+S.   wrote

    The simplest form I could find to implement is this one : Tryit Editor v3.5 - Show PHP

    Simple is right.  It doesn't do anything.  It's merely an example of PHP form field validation & sanitizing. 

    I already posted a contact form above.  Have you tried it yet?

    Contact form issue and question.

    Sorry about that. Am I mistaken, or does yours require a page refresh at every interaction, whereas the simpler one I linked to doesn't? When I hit submit without filling any fields, that's the impression those error msgs give me. Is the processing handled differently, or am I seeing things that aren't there?

    Translate
    Legend
    Nov 20, 2018 3:05 PM UTC

    We've had some clients insist  on both email links and web form. Best way to test the effectiveness of obfuscation is do a 'real world' test and use a 'fresh' obfuscated email address on your contact form and see if /how much spam you get. I did one for several months and didn't get a single Viagra email to it

    Translate
    Paul-M - Community Expert
    B i r n o u
    Legend
    Nov 21, 2018 5:36 AM UTC

    Energize  a écrit

    We've had some clients insist  on both email links and web form.

    Don't see my question as an attack, I'm just curious, what are the reasons, or advantages, that are given when your customers ask to have a direct mail link?

    Translate
    Legend
    Nov 19, 2018 3:14 AM UTC

    Here's a simple PHP obfuscation solution:

    <?php

    function protectMail($s) {

        $result = '';

        $s = 'mailto:' . $s;

        for ($i = 0; $i < strlen($s); $i++) {

          $result .= '&#' . ord(substr($s, $i, 1)) .

            ';';

        }

        return $result;

      }

    ?>  

    Then use the function like this:

    <a href="<?php echo protectMail('someone@somewhere.com'); ?>">email me</a>

    Translate
    Paul-M - Community Expert
    Under S.Author
    Inspiring
    Nov 20, 2018 12:47 AM UTC

    Energize  wrote

    Here's a simple PHP obfuscation solution:

    <?php

    function protectMail($s) {

        $result = '';

        $s = 'mailto:' . $s;

        for ($i = 0; $i < strlen($s); $i++) {

          $result .= '&#' . ord(substr($s, $i, 1)) .

            ';';

        }

        return $result;

      }

    ?>  

    Then use the function like this:

    <a href="<?php echo protectMail('someone@somewhere.com'); ?>">email me</a>

    Does this provide more protection than the solution provided by BenPleysier at the top of this thread, which everyone else discouraged me from using?

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Nov 20, 2018 1:10 AM UTC

    Server-side scripts generally provide more protection than client-side scripts.   But  MAILTO only works for people who have an e-mail client like Outlook installed on their device.  Most people use web based e-mail now.   Thus MAILTO is not 100% reliable. 

    Translate
    Nancy O'Shea— Product User & Community Expert
    Legend
    Nov 19, 2018 3:05 AM UTC

    If obfuscating email address be sure to include the 'mailto:' bit for obfuscation too.  The safest approach though is using a php script/web form that doesn't expose the email address.

    Translate
    Paul-M - Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    Sep 25, 2018 8:04 PM UTC

    I don't use Mailto links, ever. 

    A while back, spammers got hold of my e-mail address and used it inside the return headers of their spam mail campaigns.   Eventually, my e-mail was blocked for spamming and I had to shut it down.  The only way to protect yourself is to use a scripted contact form.  If you can't create one yourself, use a 3rd party service like Wufoo.com or MailChimp.  Then embed their code inside your HTML document.

    Translate
    Nancy O'Shea— Product User & Community Expert
    Under S.Author
    Inspiring
    Nov 18, 2018 4:50 PM UTC

    https://forums.adobe.com/people/Nancy+OShea  wrote

    I don't use Mailto links, ever. 

    A while back, spammers got hold of my e-mail address and used it inside the return headers of their spam mail campaigns.   Eventually, my e-mail was blocked for spamming and I had to shut it down.  The only way to protect yourself is to use a scripted contact form.  If you can't create one yourself, use a 3rd party service like Wufoo.com or MailChimp.  Then embed their code inside your HTML document.

    My hosting service openly recommends using Formspree in their knowledge base. I figure they must have some kind of deal with them for such a targeted recommendation.

    I would, however, feel more secure using a local script, than one that has its contents verified by a 3rd party at every process. I realize that almost everything that goes through the internet is a privacy risk, but isn't this just asking for trouble long-term? If you pros tell me there is virtually no downside to using Formspree for a low-traffic website, I'll probably do it just for the convenience.

    But if a local script is better, I would appreciate any recommendation you may have (especially if the installation instructions are simple).

    (I more or less finished the website since this thread was active, saving the contact form for last, ie now.)

    Translate
    B i r n o u
    Legend
    Nov 18, 2018 4:59 PM UTC

    https://forums.adobe.com/people/Under+S.  a écrit

    But if a local script is better, I would appreciate any recommendation you may have (especially if the installation instructions are simple).

    well this pieces of classes are pretty well adapted to every context... and really easy to use and set... plus there is a class.smtp very usefull... GitHub - PHPMailer/PHPMailer: The classic email sending library for PHP

    Translate
    WolfShade
    Legend
    Sep 25, 2018 1:06 PM UTC

    I totally agree with Jon Fritz II​ on this.  NEVER use a mailto link.  And no matter how anyone tries to obfuscate it, it isn't obfuscated to a machine.  It can always be undone - in fact HAS to be undone in order for the mail server to know where to send it to.

    Modal or no modal, a simple form that keeps the email address hidden is the only way to keep the email address from being harvested that will allow the user to send an email to the webadmin, or whomever the email is intended for.

    V/r,

    ^ _ ^

    Translate
    BenPleysier
    Community Expert
    BenPleysierCommunity ExpertCorrect answer
    Community Expert
    Sep 25, 2018 2:19 AM UTC
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Jon Fritz
    Community Expert
    Community Expert
    Sep 25, 2018 12:51 PM UTC

    It's an easy solution sure, but there's no way that hasn't been defeated, many, many times over, since it was created in 2003. It still uses mailto: in the source code and then converts each letter of the address to another set of "known entities". It may be better than nothing, but only just.

    @Under S.,

    The best way to protect your email address is to never allow the user's browser (or a email harvesting bot) to see it. Use a server-side "Form to Email Script". That way, the email address is safely stored on the server and completely unknown to the browser or bot. The user fills in a small form, hits send and the server processes the data then sends it to the correct email address. You can put additional security of Captcha or equivalent for real person verification steps in if you like, but even if you don't, and you get a few spam submissions, the actual email address is still unknown to bad actors.

    Translate
    Under S.Author
    Inspiring
    Sep 25, 2018 7:05 PM UTC

    The reason I didn't want to implement a form was because this is a simple single landing page offering 2 options : a PDF file (containing product list and photos) and an email link. The PDF file would've opened inside the browser or saved to disc, depending on how the user opens it. The email link would've spawned a blank pre-addressed email. In other words, there is no 2nd page to this website.

    I wouldn't mind the form idea if it was presented as an overlay instead of being called as a 2nd page. In other words, when clicking email, the form slides into view (over everything). And upon hitting send, it slides back out. This would work on both desktop and mobile.

    I don't suppose you have something similar to recommend?

    Translate