PYTHON MINI PROJECT:
We are here to see how to send an otp to an email and verify whether it is correct or not.
This can be done in many ways,now I use python language to perform this task.
Firstly, I will start by importing the necessary Python library that we need for this task:
import math — To use mathematical functions under this module, you have to import the module using import
import random — imports the random module, which contains a variety of things to do with random number generation
Import smtplib — python provides smtplib module, which defines an SMTP client
session object that can be used to send mail to any Internet machine with an SMTP
Secondly,generate a random number and store it in a variable which will be sent as otp to the users.
- With the help of random function a random number is generated.
- Now you should create your gmail(host mail) app password to send the mails.
- After you create your app password for your Gmail account you will get a key.
In the above code enter your email & app password.
COMPLETE CODE
******
Output:

Thus executing the code you can send an otp to particular mail and verify it.rt
for further details sign in to www.guvi.io