Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/OTP verification.py Secret

Created Apr 13, 2021
Embed
What would you like to do?
import os
import math
import random
import smtplib
digits="0123456789"
OTP=""
for i in range(6):
OTP+=digits[math.floor(random.random()*10)]
otp = OTP + " is your OTP"
msg= otp
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
s.login("Your Gmail Account", "You app password")
emailid = input("Enter your email: ")
s.sendmail('&&&&&&&&&&&',emailid,msg)
a = input("Enter Your OTP >>: ")
if a == OTP:
print("Verified")
else:
print("Please Check your OTP again")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment