A powerful Telegram bot for creating and managing temporary/disposable email addresses with built-in admin broadcast functionality.
| Link | Description |
|---|---|
| Bot: @tempatemailbot | Try the bot on Telegram |
| GitHub: hokireceh/tempmail | Source code repository |
Help support this project:
- EVM Address:
0xaFf68fFd9B57720018ea1e34b7B37637C022FACe - TON Address:
UQAN1eZ0Myj6JZ5nKREDKJjPJiZgRivPFwHpS19vuCa5CXy2
- ✅ Create temporary email addresses instantly
- ✅ Check incoming emails in real-time (auto-checks every 60 seconds)
- ✅ View email content with action links
- ✅ List and manage saved emails
- ✅ User-friendly menu-based interface
- ✅ Broadcast text messages to all users
- ✅ Broadcast media (photos, videos, documents, audio, animations)
- ✅ Real-time progress tracking
- ✅ Message preview before sending
- ✅ Auto-remove blocked users
- ✅ Smart retry on failed sends (up to 3 attempts)
- ✅ Rate limiting to prevent API issues
- ✅ Complete broadcast history
- Runtime: Node.js v20
- Bot Framework: node-telegram-bot-api
- Database: PostgreSQL
- External API: TMailor for temporary emails
/start- Show main menu/menu- Return to main menu
- 📧 Buat Email Baru - Create new temporary email
- 🔍 Cek Email Masuk - Check incoming emails
- 📋 Daftar Email Saya - List your emails
- ❓ Bantuan - Get help
- 📢 Broadcast - Send broadcast (admins only)
/broadcast [message]- Send text broadcast- Example:
/broadcast 📢 Hello everyone!
- Example:
Required:
TELEGRAM_BOT_TOKEN- Get from @BotFatherDATABASE_URL- PostgreSQL connection (auto-provided by Replit)
Optional:
ADMIN_IDS- Comma-separated admin IDs (e.g., "123456789,987654321")TMAILOR_API- TMailor endpoint (default: https://tmailor.com/api)CHECK_INTERVAL- Email check interval in ms (default: 60000)BROADCAST_RATE_LIMIT- Messages/second (default: 25)
Stores temporary email accounts
| Column | Type | Description |
|---|---|---|
| id | serial | Primary key |
| user_id | integer | Telegram user ID |
| varchar | Temporary email address | |
| code | varchar | Email code from API |
| token | varchar | Access token for API |
| created_at | timestamp | Creation time |
| last_checked | timestamp | Last check time |
Tracks bot users
| Column | Type | Description |
|---|---|---|
| user_id | integer | Primary key (Telegram ID) |
| username | varchar | Telegram username |
| first_name | varchar | User's first name |
| last_name | varchar | User's last name |
| created_at | timestamp | Registration time |
| last_interaction | timestamp | Last activity time |
Logs broadcast messages
| Column | Type | Description |
|---|---|---|
| id | serial | Primary key |
| admin_id | integer | Admin who sent broadcast |
| broadcast_type | varchar | 'text' or 'media' |
| content_text | text | Message content |
| media_file_id | varchar | Telegram file ID |
| media_type | varchar | photo, video, document, etc |
| total_users | integer | Users targeted |
| success_count | integer | Successful deliveries |
| failed_count | integer | Failed deliveries |
| created_at | timestamp | Broadcast time |
| completed_at | timestamp | Completion time |
- Node.js v20
- PostgreSQL database
- Telegram Bot API token
- Clone the repository
git clone https://github.com/hokireceh/tempmail.git
cd tempmail- Install dependencies
npm install- Set environment variables
export TELEGRAM_BOT_TOKEN=xxx
export DATABASE_URL=postgres://user:pass@localhost:5432/tempmail
export ADMIN_IDS=your_telegram_id
export DB_POOL_SIZE=50
export CONCURRENT_CHECKS=20- Start the bot
npm start- Update
git fetch origin
git reset --hard origin/main- Admin clicks 📢 Broadcast button in menu
- Bot asks for message or media
- Admin sends text, photo, video, or document
- Bot shows a preview of the message
- Admin confirms with ✅ Ya, Kirim button
- Bot broadcasts to all users with:
- Rate limiting (25 msg/sec)
- Progress tracking (10%, 20%, 30%... 100%)
- Smart retry on failures
- Auto-cleanup of blocked users
- Final report shows:
- ✅ Successfully delivered
- ❌ Failed (will retry)
- 🚫 Blocked users (auto-removed)
- Protected Content: Broadcast media can't be forwarded or downloaded
- User Isolation: Users only see their own emails
- Admin Verification: Broadcasts require explicit admin confirmation
- Rate Limiting: Prevents API abuse and Telegram rate limits
- Auto-Cleanup: Blocked users are automatically removed
tempmail/
├── index.js # Main bot application
├── smartBroadcaster.js # Broadcast service with queue & retry
├── db-init.js # Database initialization
├── package.json # Dependencies
├── README.md # This file
└── replit.md # Technical documentation
Bot not responding?
- Check
TELEGRAM_BOT_TOKENis correct - Verify bot is running:
npm start
Broadcast not working?
- Ensure
ADMIN_IDScontains your Telegram user ID - Check user database isn't empty
Email not checking?
- Verify TMailor API is accessible
- Check
CHECK_INTERVALsetting
This project is open source. Feel free to use, modify, and distribute.
Special thanks to all users and contributors!
Made with ❤️ HOKIRECEH