In settings.py
:
- Change the dafault settings: to_email, from_email, password .... etc
-
Generate an App Password:
- Go to your Google Account settings.
- Navigate to "Security" and then "App passwords".
- Choose "Mail" and "Other (custom name)".
- Follow the prompts to generate a 16-character password.
-
Enable Less Secure Apps (Optional but not recommended for main accounts):
- Go to your Google Account settings.
- Navigate to "Security".
- Turn on "Less secure app access".
-
Install Necessary Libraries:
- Make sure you have
smtplib
andemail
libraries installed. If not, install them using pip:orpip install secure-smtplib pip install email
pip install -r requirements.txt
- Make sure you have
-
Create a Telegram Bot:
- Open the Telegram app and search for "BotFather" (official Telegram bot for managing bots).
- Start a chat with BotFather.
- Type
/newbot
and send the message. - Follow the instructions to choose a name and username for your bot. The username must end in "bot" (e.g., MyComfyUIBot).
- After creating the bot, BotFather will provide you with an HTTP API token. This token is required to send messages using your bot.
-
Get Your Chat ID:
- Find your bot by searching for its username in Telegram.
- Start a chat with your bot by clicking "Start".
- To get your chat ID, you can send a message to your bot and then use the Telegram API to get your chat ID.
- Open a web browser and navigate to:
Replace
https://api.telegram.org/bot<YourBotToken>/getUpdates
<YourBotToken>
with the token you received from BotFather. - Look for the
chat
object in the response. Your chat ID will be listed asid
.
- Open a web browser and navigate to: