Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1201376

    Hi there,
    I hope you guys have an idea why this is not working.
    I found an instruction on how to realise a clickable mailto: link wich is handled by a PHP script (email-handler.php) so that it is more or less not readable by bots.

    The Code to send an email in this example to (Email address hidden if logged out) (also a little bit “encrypted”) would look like this:
    <a href="/email-handler.php">mail<span style="display: none;">no-spam-please</span>@<span style="display: inline;">domain.com</span></a>
    …so far so good.

    Then I put the corresponding PHP file email-handler.php in to the root folder of WP. The content of this file would look like this:

    <?php
         /* content of the file "email_handler.php" */
         header ("Location: mailto: (Email address hidden if logged out) ");
         exit();
    ?>

    I did this allready on another WP website using enfold and it worked. Now I tried to use this trick on another site also using enfold and it w’ont work at all. Just getting 404 Errors.

    I know this is maybe not a theme-issue but I don´t understand why it works on one installation and not on the other one.

    Any Clue ? Help would be really appreciated.
    Or maybe you have a better way to have a safe mailto: link on an enfold website??

    Best Regards,
    GePu

    • This topic was modified 4 years, 7 months ago by GePu.
    #1201530

    Update:

    It was a simple mistake. In this case the code on the page was linking to the wrong directory because it was not the root directory of the domain but the root directory of wordpress. (in most cases it would be the same but not in that ceretain case)

    Problem fixed !

    GePu

    #1201601

    Hi,

    Great, I’m glad that you got things working and thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1216004

    Hello

    can you please give advise on ‘How to add mailto link in a text block that opens the link in a new tab to whatever email client in use is

    I have simply used mailto: (Email address hidden if logged out) and it work fine ,
    BUT opens the link on the same tab, that forces the user to abondon the site…..this is not what I want.

    Regards

    Roberto

    #1216096

    Sorry,
    I don´t understand the problem. The mailto-function (usuallly) opens a new e-mail using the mail-program of the visitor of your website, prefilled with your mail-adress as recipient. It should not open a new tab of your browser.

    There should not be any new tab that opens.

    If so, then give a look at the settings of your link by clicking on the gear-symbol in the pop-up of the editor. There you can use the checkbox to define if the link opens in a new tab or the same tab. Maybe this will fix the problem.

    Regards,

    GePu

    #1216421

    Thank GePu,

    Resolved I simply missed the checkbox to define that the link must open in a new tab

    Regards
    Roberto

    #1218731

    Hi,

    Awesome! Glad to know that you figured it out. We’ll close this thread now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘email handler PHP script – help needed’ is closed to new replies.