A modern Telegram bot that monitors your emails and provides SMTP functionality for sending emails directly through Telegram commands.
- 📧 Email Monitoring: Real-time email notifications via Telegram
- 📤 SMTP Support: Send emails directly through Telegram commands
- 🔒 Secure: Modern authentication and secure connections
- 🌐 Multi-Provider: Works with Gmail, Outlook, and other SMTP/IMAP providers
- 🚀 Modern TypeScript: Fully typed with latest Node.js features
- 📊 Status Monitoring: Check connection status and uptime
- 🛡️ Error Handling: Comprehensive error handling and graceful shutdown
Since Google discontinued "less secure apps", you now need to use App Passwords:
Step 1 • Enable 2-Factor Authentication on your Google Account
Step 2 • Go to Google Account Settings
Step 3 • Navigate to "2-Step Verification" → "App passwords"
Step 4 • Generate an App Password for "Mail"
Step 5 • Use this App Password as your password environment variable
Step 6 • Enable IMAP in Gmail Settings → Forwarding and POP/IMAP
For other providers (Outlook, Yahoo, etc.), configure the SMTP/IMAP settings accordingly using the optional environment variables.
/start- Initialize the bot/helpor/commands- Show available commands/uptime- Display bot uptime/license- Get license information/send <email> <subject> <message>- Send email via SMTP/status- Check SMTP connection status
# Install dependencies
npm install
# Development mode
npm run dev
# Build and start
npm run build
npm startThe bot can be deployed on various platforms like Heroku, Railway, Render, or any Node.js hosting service.
botToken- Bot token from @BotFatheruserId- Your Telegram user IDlogin- Your email addresspassword- Your email password (App Password for Gmail)
SMTP_HOST- SMTP server host (default: smtp.gmail.com)SMTP_PORT- SMTP server port (default: 587)SMTP_SECURE- Use secure connection (default: false)
IMAP_HOST- IMAP server host (default: imap.gmail.com)IMAP_PORT- IMAP server port (default: 993)
botToken=your_bot_token_here
userId=your_telegram_user_id
login=[email protected]
password=your_app_password_here
# Optional: Custom SMTP settings
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
# Optional: Custom IMAP settings
IMAP_HOST=imap.gmail.com
IMAP_PORT=993If you're upgrading from the previous version:
- Update your
passwordto use App Password (for Gmail) - Install new dependencies:
npm install - Update environment variables as needed
- The bot now supports sending emails via
/sendcommand
- Runtime: Node.js 18+
- Language: TypeScript
- Email Libraries: nodemailer (SMTP), imapflow (IMAP), mailparser
- Bot Framework: Telegraf
- Deployment: Docker support included
telegraf- Telegram Bot API frameworknodemailer- SMTP email sendingimapflow- Modern IMAP clientmailparser- Email parsingchalk- Terminal styling
typescript- TypeScript compilerts-node- TypeScript execution@types/node- Node.js type definitions@types/nodemailer- Nodemailer type definitions
This project is licensed under the MIT License - see the LICENSE file for details.