During this time, we have modified the login function of our system, and added a verification function for sending emails for greater security. When the user logs in, it is judged whether the login IP has been logged in before. If not, a verification code needs to be sent to the mailbox, and then the received verification code must be entered before logging in. If the verification code is correct and the time has not exceeded the specified time, you can Log in, and write down the IP and time of this login. If you log in with this IP in the future, you will not need to verify it. If the time exceeds, the verification code becomes invalid and needs to be sent again. If there is a verification error and you cannot log in, you need to re-enter the verification code or send a new verification code to your email. In order to implement this function, I used the knowledge of how to send emails to the mailbox and obtain the login IP. Let’s sort it out so that you can check it out later.
Send an email:
First you need to download the compressed package of phpmail, then decompress it, and copy the decompressed file to the project. Import files into the project.