-
-
Save amankharwal/acbc3b242a56637c16f5c94e4b89cb40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os,math | |
import random,sys | |
import smtplib | |
mailid=sys.argv[1] | |
digits="0123456789" | |
OTP="" | |
for i in range(6): | |
OTP+=digits[math.floor(random.random()*10)] | |
msg='Your OTP Verification for app is '+OTP+' Note.. Please enter otp within 2 minutes and 3 attempts, otherwise it becomes invalid' | |
file2=open("otp.txt","w") | |
file2.write(OTP) | |
file2.close() | |
s = smtplib.SMTP('smtp.gmail.com', 587) | |
s.starttls() | |
s.login("your email id", "your app password") | |
print(msg) | |
s.sendmail('your email id',mailid,msg) | |
os.system('python second.py') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment