mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-07 08:22:52 +08:00
af7824814526ecd3698b1214d6e9eda50629feaa
…
…
cloudflare temp email
中文
Live Demo
This is a temporary email service that uses Cloudflare Workers to create a temporary email address and view the received email in web browser.
Features
- Cloudflare D1 as a database
- Deploy the front end with Cloudflare Pages
- Deploy the backend with Cloudflare Workers
- Email forwarding using Cloudflare Email Routing
- Use password to login to the previous mailbox again.
- Get Custom Name Email
- Support multiple languages
- Add access authorization, which can be used as a private site
- Exceeded CPU Limit error caused by the free version of the attachment
Deploy
DB - Cloudflare D1
# create a database, and copy the output to wrangler.toml in the next step
wrangler d1 create dev
wrangler d1 execute dev --file=db/schema.sql
Backend - Cloudflare workers
cd worker
pnpm install
# copy wrangler.toml.template to wrangler.toml
# and add your d1 config and these config
# PREFIX = "tmp" - the email create will be like tmp<xxxxx>@DOMAIN
# IF YOU WANT TO MAKE YOUR SITE PRIVATE, UNCOMMENT THE FOLLOWING LINES
# PASSWORDS = ["123", "456"]
# For admin panel
# ADMIN_PASSWORDS = ["123", "456"]
# DOMAINS = ["xxx.xxx1" , "xxx.xxx2"] you domain name
# JWT_SECRET = "xxx"
# BLACK_LIST = ""
cp wrangler.toml.template wrangler.toml
# deploy
pnpm run deploy
you can find and test the worker's url in the workers dashboard
enable email route and config email forward catch-all to the worker
Frontend - Cloudflare pages
cd frontend
pnpm install
# add .env.local and modify VITE_API_BASE to your worker's url
# VITE_API_BASE=https://xxx.xxx.workers.dev - don't put / in the end
cp .env.example .env.local
pnpm build --emptyOutDir
pnpm run deploy
Languages
TypeScript
45.7%
Vue
44.8%
Python
4.7%
JavaScript
3.9%
Rust
0.6%
Other
0.3%




