Advertisement
harsh7i

SendAolMail.py

Jun 20th, 2022 (edited)
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. import smtplib
  2. import random
  3. from email.mime.multipart import MIMEMultipart
  4. from email.mime.text import MIMEText
  5.  
  6. # Connecting To Server
  7. server=smtplib.SMTP_SSL('smtp.aol.com',465)
  8.  
  9. # Variables
  10. password='udnjulhngetulijt'
  11. to_email=input('Enter a Valid Email: ')
  12. to_email=str(to_email)
  13. verify_code=random.randint(12345,98765)
  14. verify_code=str(verify_code)
  15. message="This is Your Verification Code to Confirm email."
  16.  
  17. # Message
  18. msg=MIMEMultipart()
  19. msg['Subject']="TODO: Your Verification Code is "+verify_code
  20. msg['From']=email
  21. msg['To']=to_email
  22. msg.attach(MIMEText(message,'plain'))
  23.  
  24.  
  25. # Login in Server
  26. server.login(email,password)
  27.  
  28. # Sending Mail
  29. server.sendmail(email,to_email,msg.as_string())
  30.  
  31. # Server Quit
  32. server.quit()
  33.  
  34. # Conclusion
  35. print("Your Message with Code "+verify_code+" has been successfully sent to "+to_email)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement