A modern, secure, and user-friendly temporary email service built with FastAPI and powered by the mail.tm API. Create disposable email addresses instantly with a beautiful web interface and RESTful API.
π Try TempMail Live - Experience the full functionality of TempMail hosted on Render.
- π Instant Email Creation: Generate unique, professional-looking temporary email addresses
- π Dark/Light Theme: Modern UI with theme switching capability
- π± Responsive Design: Works seamlessly on desktop and mobile devices
- π Secure & Private: No data storage, completely anonymous
- β‘ FastAPI Backend: High-performance async API with automatic retries
- π¨ Beautiful UI: Clean, modern interface with smooth animations
- π§ Real-time Messages: Fetch and display emails instantly
- π Auto-refresh: Automatic message checking with manual refresh option
- π‘οΈ CORS Enabled: Cross-origin requests supported
- π Copy to Clipboard: Easy copying of email addresses and content
- Backend: FastAPI, Python 3.8+
- Frontend: HTML5, CSS3, Vanilla JavaScript
- API: mail.tm API integration
- Styling: Custom CSS with CSS Variables
- Icons: Font Awesome (via CDN)
- Libraries:
fastapi- Modern web frameworkuvicorn- ASGI serverrequests- HTTP clienttenacity- Retry mechanism
- Python 3.8 or higher
- pip (Python package installer)
-
Clone the repository
git clone https://github.com/Saksham-Goel1107/TempMail.git cd TempMail -
Install dependencies
pip install -r requirements.txt
-
Run the application
uvicorn app:app --reload
-
Open your browser
http://127.0.0.1:8000
TempMail now supports Docker for easy deployment and development:
# Clone the repository
git clone https://github.com/Saksham-Goel1107/TempMail.git
cd TempMail
# Build and run with Docker Compose
docker-compose up --build# Build the image
docker build -t tempmail .
# Run the container
docker run -p 8000:8000 tempmail# Run in background
docker-compose up -d
# Stop the application
docker-compose down
# View logs
docker-compose logs -f
# Rebuild after changes
docker-compose up --build --force-recreateThe application will be available at http://localhost:8000
- Open the application in your browser
- Click "Create New Email" to generate a temporary email address
- Use the generated email address wherever you need a temporary email
- Check for incoming messages using the refresh button
- Messages will be displayed in a clean, readable format
The application provides a RESTful API for programmatic access:
curl -X POST "http://localhost:8000/create_account"Response:
{
"email": "cool_user_abc123@domain.com",
"token": "your_jwt_token_here"
}curl -X GET "http://localhost:8000/messages?token=YOUR_TOKEN"Response:
{
"messages": [
{
"id": "message_id",
"from": "sender@example.com",
"subject": "Test Email",
"text": "Plain text content",
"html": ["<p>HTML content</p>"],
"date": "2024-01-01T12:00:00Z",
"hasAttachments": false
}
]
}| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Serve the web interface |
POST |
/create_account |
Create a new temporary email account |
GET |
/messages?token={token} |
Fetch messages for an account |
The application uses the following configuration:
- Base URL:
https://api.mail.tm(mail.tm API) - CORS: Enabled for all origins
- Retry Policy: 3 attempts with exponential backoff
- Username Generation: Unique, readable usernames with hash-based uniqueness
- FastAPI application with CORS middleware
- Integration with mail.tm API
- Automatic retry mechanism for API calls
- Unique username generation algorithm
- Secure password generation
- Responsive web interface
- Dark/Light theme support
- Real-time message fetching
- QR code generation for email addresses
- Copy-to-clipboard functionality
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
# Install development dependencies
pip install -r requirements-dev.txt
# Run with auto-reload
uvicorn app:app --reload --host 0.0.0.0 --port 8000- mail.tm for providing the temporary email API
- FastAPI for the amazing web framework
- Tenacity for retry mechanisms
- QRCode.js for QR code generation
- DOMPurify for HTML sanitization
If you have any questions or issues, please open an issue on GitHub or contact the maintainers.
Made with β€οΈ by Saksham Goel