We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c0e4b58 + daab69d commit 1e1ec86Copy full SHA for 1e1ec86
OTP generator.py
@@ -0,0 +1,22 @@
1
+import os
2
+import math
3
+import random
4
+import smtplib
5
+digits = "012456789"
6
+OTP = ""
7
+for i in range(4):
8
+ OTP += digits[math.floor(random.random() * 10)]
9
+msg = str(OTP) + "Your OTP is"
10
+
11
+s = smtplib.SMTP('smtp.gmail.com', 587)
12
+s.starttls()
13
14
+emailid = "receiver's id"
15
+s.login("sender's id", "google app password")
16
+s.sendmail("sender's id", emailid, msg)
17
+a = input("Enter the OTP >>: ")
18
+if a == OTP:
19
+ print("Verified")
20
+else:
21
+ print("Incorrect OTP")
22
+s.quit()
0 commit comments