This file contains hidden or 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
# ---------------------------------------------------------- | |
# You need to have a file named ".env" and environment variables should be defined there before running this code, | |
# Alternatively you can edit this code and hadcode your api key and sender email id and password | |
# Important Note: you need to create app password for your gmail and use it here instead of gmail login password. | |
# ---------------------------------------------------------- | |
import imaplib | |
import email |