简体   繁体   中英

How to verify an email by the making the button working properly?

I am working on an email verification functionality. The problem is that I want if someone clicks on the Confirm email address button then an alert should be shown up or a user should be notified the button is clicked but it does not perform any actions on my Gmail account.

What are the ways to make it work?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <center><h1>We're glad you're here</h1></center>
    <center>We just want to confirm it's you.<br><br></center>
    <center>
        <button onclick="myFunction()">
            Click to confirm your email address
        </button>
    <center>
    <center><br>If you didn't create a proctl account, just delete this email.</center>

    <script>
        function myFunction() {
          alert("I am an alert box!");
        }
    </script>
</body>
</html>

Due to security concerns, Javascript is not supported in email messages. So instead of verifying it by js onclick event, you can insert an HTML link to it.

Ref: Is JavaScript supported in an email message?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM