A temporary email service built for Cloudflare Pages with Email Workers.
User Browser (unknownlll2829.qzz.io)
↓
Cloudflare Pages (Frontend + API)
↓
Cloudflare KV (Storage)
↓
Cloudflare Email Worker (Receives emails)
temp-email/
├── public/
│ ├── index.html # Main frontend page
│ └── app.js # Frontend JavaScript
├── functions/
│ └── api/
│ ├── generate.js # Generate temp email API
│ └── emails.js # Fetch emails API
├── .gitignore
└── README.md
This repository is deployed on GitHub Pages as a view-only demo. The fully functional site is available at https://unknownlll2829.qzz.io/ and should be used for real temp-mail functionality.
- ✅ Static UI, layout, and styling
- ✅ Buttons, modals, and basic client-side interactions
- ❌ Temp email generation and inbox fetching (
/api/*endpoints require Cloudflare Pages Functions) - ❌ QR code generation endpoint (
/api/qr) - ❌ Authentication (OTP send/verify)
- ❌ Email worker-backed storage (Cloudflare KV)
- Push changes to the
mainbranch. - In your GitHub repository settings, set Pages → Source to GitHub Actions.
- The workflow at
.github/workflows/deploy.ymlwill build and deploy the static site automatically.
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourusername/temp-mail.git
git push -u origin main- Go to Cloudflare Dashboard → Pages
- Create a project → Connect to Git
- Select your repository
- Build settings:
- Build command: (leave empty)
- Build output directory:
/public
- Deploy
- Go to Pages project → Settings → Functions
- Add KV namespace bindings:
TEMP_EMAILS→ Your TEMP_EMAILS KV namespaceEMAILS→ Your EMAILS KV namespace
- Pages project → Custom domains
- Add:
unknownlll2829.qzz.io
Update your email-handler worker to store incoming emails:
export default {
async email(message, env, ctx) {
try {
const recipientEmail = message.to;
const emailData = await env.TEMP_EMAILS.get(recipientEmail);
if (!emailData) {
message.setReject("Address not found");
return;
}
const from = message.from;
const subject = message.headers.get("subject") || "(No Subject)";
const rawEmail = await streamToString(message.raw);
const body = extractEmailBody(rawEmail);
const emailContent = {
from: from,
to: recipientEmail,
subject: subject,
body: body,
timestamp: Date.now()
};
const emailKey = `email:${recipientEmail}:${Date.now()}`;
await env.EMAILS.put(emailKey, JSON.stringify(emailContent), { expirationTtl: 3600 });
} catch (error) {
console.error("Error:", error);
}
}
};- ✨ Instant email generation
- 📬 Real-time email checking
- 🔄 Auto-refresh every 5 seconds
- 📋 One-click copy
- ⏱️ 1-hour expiration
- 🔒 Private & secure
MIT