Php mail solution _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Solve the php mail sending problem. During this period, the login function of our system was modified. in order to be more secure, the Mail verification function was added. When a user logs on, he or she checks whether the logon ip address was previously logged on. for example, he modified the login function of our system during this time period. in order to be more secure, he or she added the mail verification function. When a user logs on, he or she determines whether the logon ip address has been previously logged on. if not, he or she needs to send a verification code to the mailbox and then enter the verification code he or she received before logging on, if the verification code is correct and the time does not exceed the specified time, you can log on and write down the ip address and time of the login. if you log on with this ip address later, you do not need to verify it. If the verification code expires, you must resend it. Verification error cannot be logged in. you need to re-enter the verification code or send a new verification code to your mailbox. To implement this function, I used the knowledge of how to send emails to my mailbox and obtain the logon ip address. Below, you can view it later.

Send email:

Download the phpmail compressed package, decompress it, and copy the extracted file to the project. Introduce files to the project.

The code is as follows:


Require ("phpmailer/class. phpmailer. php"); // the file path depends on the path in your project.

Bytes. When a user logs on, determine whether the logon ip address is previously logged on, such...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.