Skip to main content
Inspiring
September 25, 2018
Answered

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

  • September 25, 2018
  • 7 replies
  • 2621 views

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 has been closed for replies.
    Correct answer BenPleysier

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

    7 replies

    Under S.Author
    Inspiring
    November 21, 2018

    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!

    Nancy OShea
    Community Expert
    Community Expert
    November 21, 2018

    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.

    Nancy O'Shea— Product User & Community Expert
    Under S.Author
    Inspiring
    November 22, 2018

    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?

    Legend
    November 20, 2018

    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

    Paul-M - Community Expert
    B i r n o u
    Legend
    November 21, 2018

    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?

    Legend
    November 19, 2018

    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>

    Paul-M - Community Expert
    Under S.Author
    Inspiring
    November 20, 2018

    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?

    Nancy OShea
    Community Expert
    Community Expert
    November 20, 2018

    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. 

    Nancy O'Shea— Product User & Community Expert
    Legend
    November 19, 2018

    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.

    Paul-M - Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    September 25, 2018

    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.

    Nancy O'Shea— Product User & Community Expert
    Under S.Author
    Inspiring
    November 18, 2018

    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.)

    B i r n o u
    Legend
    November 18, 2018

    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

    WolfShade
    Legend
    September 25, 2018

    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,

    ^ _ ^

    BenPleysier
    Community Expert
    BenPleysierCommunity ExpertCorrect answer
    Community Expert
    September 25, 2018
    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
    September 25, 2018

    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.

    WolfShade
    Legend
    September 25, 2018

    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?


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

    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.

    This is a 'modal' that you are referring to.  If you are using any kind of CSS library like Bootstrap or W3 CSS, it's simple to do, and it means submitting the form via AJaX in the background instead of actually submitting the page which will 'refresh' the page.  So a combination of CSS and JavaScript will take care of it.

    V/r,

    ^ _ ^