I am currently working on the PHP project in which I have to send the verification mail to the user who register in the site. (Email id is the username). I am having the following doubt.
Please help me in this problem. Thanks in advance
you have to send mail after registration save details in db with key(that will send with link) and status like 0 in database . if they click on that link then delete activation key from database and also change status into 1 and on login you also need to check user have status 1 if not then you can show alert like Mail Confirmation Pending .
after send mail you can check mail sent or not .check this question
I suggest you store the user in database and then send the verification email. In the database keep a field to mark whether user verified the email or not.
Give user an option to resend email verification incase they didn't receive.
As far as from my experience
Enter details in DB and then send the verification mail, else your in a situation that you cant verify the user back again.
In-case email sending fails from your side, provide a option for the user to request for resending of the verification mail.
Maintain a status in the DB whether a user is verified or not, and based on that you can resend the verification mail.
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.