Tagged: mailto
-
AuthorPosts
-
April 6, 2020 at 9:01 pm #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.
April 7, 2020 at 10:03 am #1201530Update:
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
April 7, 2020 at 1:47 pm #1201601Hi,
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,
RikardMay 25, 2020 at 7:53 am #1216004Hello
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
May 25, 2020 at 12:33 pm #1216096Sorry,
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
May 26, 2020 at 10:17 am #1216421Thank GePu,
Resolved I simply missed the checkbox to define that the link must open in a new tab
Regards
RobertoJune 2, 2020 at 11:12 am #1218731 -
AuthorPosts
- The topic ‘email handler PHP script – help needed’ is closed to new replies.