DEV Community

Cover image for I Built TTMAIL: A Fast, Serverless Disposable Temp Mail Service with Next.js 15 & Cloudflare D1
TTMAIL
TTMAIL

Posted on

I Built TTMAIL: A Fast, Serverless Disposable Temp Mail Service with Next.js 15 & Cloudflare D1

Hey fellow developers! πŸ‘‹

We all need disposable email addresses for testing signup flows, verifying OTPs, or keeping our personal inboxes clean from newsletter spam. However, most existing temp mail websites are bloated with ads, slow, and lack developer-friendly features like custom aliases or easy API access.

So, I built TTMAIL β€” a lightweight, privacy-first, serverless temporary disposable email platform built on modern web technologies.


⚑ Live Demo & Source


πŸ› οΈ The Tech Stack Behind It

I wanted the architecture to be blazingly fast, edge-rendered, and cost-effective:

  • Frontend: Next.js 15 (App Router), Tailwind CSS, Framer Motion (Neo-Brutalist design)
  • Hosting & Edge Compute: Cloudflare Pages & Cloudflare Workers (0ms cold start)
  • Database: Cloudflare D1 (Serverless SQLite at the edge)
  • Email Processing: Cloudflare Email Routing + Custom Email Worker Parser

πŸš€ Key Features

  1. Instant Auto-Generation: Get an active temporary inbox in 0.0 seconds without signing up.
  2. Multi-Domain Support: Switch between active domains (@trytempmail.co, @reftasker.top, @rewardlist.com, @chorachain.com) in one click.
  3. Password-Protected Recovery: Set a custom alias and password so you can access your temporary inbox across multiple devices anytime at /recover.
  4. Developer REST API: Real-time JSON endpoints to fetch active domains and receive incoming emails for automated end-to-end testing (Cypress / Playwright / Puppeteer).
  5. Ultra-Fast & Zero Spam: Optimized for Core Web Vitals (100/100 PageSpeed score) with real-time SSE / polling.

πŸ’» Quick API Example for Developers

Want to programmatically fetch received emails during automation tests?


bash
# 1. Fetch all available domains
curl https://trytempmail.co/api/domains

# 2. Fetch incoming emails for a specific mailbox
curl "https://trytempmail.co/api/emails?mailbox=your_custom_alias@trytempmail.co"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)