chome4 Posted August 8, 2020 Share Posted August 8, 2020 Working through a 'register/login with verify' script to make it work for my setup, and it does! Unfortunately, the email asking me to verify my form details doesn't have a clickable link, just a url that I can copy/paste and get into the page. The original line of code from the script reads: $url = 'http://'.$_SERVER['SERVER_NAME'].'/property7/register/verify.php?id='.$lastId.'&token='.$token; And, following some instructions from another source, I change it to: $url = 'http://'.$_SERVER['SERVER_NAME'].'/property7/register/verify.php?id='.$lastId.'&token='.$token; $url_components = parse_url($url); parse_str($url_components['query'], $params); But it gave the same result, image attached. Can someone inform me as to what to do to get the link in the email to appear in link form so I can maybe turn it into a button? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/ Share on other sites More sharing options...
requinix Posted August 8, 2020 Share Posted August 8, 2020 If you send text emails then it's up to the email client to decide whether to convert the URL into a clickable email. Nearly all of them do. Yours aren't links because you're linking to localhost. If it was a .com or .net or one of the usual types of domain names then it would (probably) be made into a link. Switch that, or send HTML emails. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580455 Share on other sites More sharing options...
chome4 Posted August 9, 2020 Author Share Posted August 9, 2020 9 hours ago, requinix said: If you send text emails then it's up to the email client to decide whether to convert the URL into a clickable email. Nearly all of them do. Yours aren't links because you're linking to localhost. If it was a .com or .net or one of the usual types of domain names then it would (probably) be made into a link. Switch that, or send HTML emails. I've tried several tutorials on registrations and, apart from the one I'm now using, they've contained errors and the creators haven't responded. But at least two of them did produce clickable links - unfortunately, I deleted the folders containing the code! I've since read that it's best to retain a non-clickable link as an option as not all systems can handle actual links. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580466 Share on other sites More sharing options...
requinix Posted August 9, 2020 Share Posted August 9, 2020 11 minutes ago, chome4 said: I've since read that it's best to retain a non-clickable link as an option as not all systems can handle actual links. There's been a bit of a push in recent years for better email security, including showing people URLs they can copy and paste if they're not sure about authenticity, but virtually everyone is capable of handling actual links. It's one of the most basic principles of HTML emails. Anyway, if you don't want then don't. You can put a plain URL into an email. But it has to have a domain that looks real for a client or email service to automatically link it for the user. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580470 Share on other sites More sharing options...
chome4 Posted August 9, 2020 Author Share Posted August 9, 2020 2 hours ago, requinix said: There's been a bit of a push in recent years for better email security, including showing people URLs they can copy and paste if they're not sure about authenticity, but virtually everyone is capable of handling actual links. It's one of the most basic principles of HTML emails. Anyway, if you don't want then don't. You can put a plain URL into an email. But it has to have a domain that looks real for a client or email service to automatically link it for the user. I've uploaded everything into a .org domain and the result is the same. Strange. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580474 Share on other sites More sharing options...
requinix Posted August 9, 2020 Share Posted August 9, 2020 Then... maybe Yahoo isn't being very nice and isn't automatically creating the link for you. Sounds like you'll have to switch to HTML emails. They don't have to be very complicated messages. In fact for simple emails you can probably just get away with <html> <body> Thanks for registering with {$server}. Please click this link to complete this registration:<br> <a href="{$url}">{$url}</a> </body> </html> Now sending the email, that's potentially complicated. But only a little. Depends on your application. Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580477 Share on other sites More sharing options...
chome4 Posted August 9, 2020 Author Share Posted August 9, 2020 2 hours ago, requinix said: Then... maybe Yahoo isn't being very nice and isn't automatically creating the link for you. Sounds like you'll have to switch to HTML emails. They don't have to be very complicated messages. In fact for simple emails you can probably just get away with <html> <body> Thanks for registering with {$server}. Please click this link to complete this registration:<br> <a href="{$url}">{$url}</a> </body> </html> Now sending the email, that's potentially complicated. But only a little. Depends on your application. A further development: I specified a gmail address when I filled-in the registration form and the verify email's link was clickable. Seems that the issue lies with the Yahoo side of things! Quote Link to comment https://forums.phpfreaks.com/topic/311293-verify-email-link-in-email-not-clickable/#findComment-1580480 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.