- 🎯 Privacy-friendly, no registration required, out-of-the-box
✈️ Support email sending and receiving- ✨ Support saving passwords and retrieving email addresses
- 😄 Support multiple domain name suffixes
- 🔌 Open RESTful API, support programmatic access
- 🚀 100% open source, quick deployment, pure Cloudflare solution, no server required
Principles:
- Receiving emails (Cloudflare Email Worker)
- Display email (Vite + React on Cloudflare Pages)
- Mail Storage (Cloudflare D1)
- Send email using MailChannels API
Vmail provides a complete RESTful API for programmatic access to create temporary mailboxes and query inboxes.
Visit the API Documentation Page to create a free API Key.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/mailboxes |
Create temporary mailbox |
GET |
/api/v1/mailboxes/:id |
Get mailbox information |
GET |
/api/v1/mailboxes/:id/messages |
Get inbox (with pagination) |
GET |
/api/v1/mailboxes/:id/messages/:messageId |
Get message details |
DELETE |
/api/v1/mailboxes/:id/messages/:messageId |
Delete message |
# 1. Create temporary mailbox
curl -X POST https://vmail.dev/api/v1/mailboxes \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json"
# Response: { "data": { "id": "abc123", "address": "[email protected]", ... } }
# 2. Query inbox
curl https://vmail.dev/api/v1/mailboxes/abc123/messages \
-H "X-API-Key: your-api-key"
# 3. Get message details
curl https://vmail.dev/api/v1/mailboxes/abc123/messages/msg_001 \
-H "X-API-Key: your-api-key"Full documentation: https://vmail.dev/api-docs
This project is now fully based on Cloudflare Pages and Cloudflare D1, which greatly simplifies the deployment process. All you need is a domain name hosted on Cloudflare.
- Cloudflare account and a domain name hosted on Cloudflare
- Local installation of Node.js (version >= 18.x) and pnpm
This project includes a pre-configured GitHub Action workflow to help you automatically deploy the Vmail application to Cloudflare.
For detailed steps, please refer to the GitHub Action Auto-Deployment Tutorial.
-
Clone the project locally
git clone https://github.com/oiov/vmail cd vmail pnpm install -
Create a Cloudflare D1 Database Create a D1 database in the Cloudflare dashboard or using the Wrangler CLI.
-
Configure
wrangler.tomlReplace the${...}placeholders in thewrangler.tomlfile in the root directory with your Cloudflare and D1 configuration information. You can also set these values through environment variables in Cloudflare Pages. -
Build and Deploy
# Build the frontend application pnpm run build # Deploy to Cloudflare pnpm run deploy
Wrangler will automatically handle the deployment of frontend static assets and the Worker, and apply database migrations according to the configuration.
-
Configure Email Routing Rules In your Cloudflare domain management interface, go to
Email->Email Routing->Routes, set up aCatch-allrule, and set the action toSend to a Worker, selecting the Worker you just deployed.
-
Copy the environment variable file
# This command creates a local environment variable file that wrangler dev will load automatically cp .env.example .env -
Fill in local environment variables Fill in the necessary environment variables in the
.envfile, especiallyD1_DATABASE_ID, etc. You need to create a D1 database in Cloudflare for local development first. -
Start the development server
pnpm run dev
This command starts both the frontend Vite development server and the local Wrangler Worker environment at the same time.
When deploying to Cloudflare Pages, you need to configure the following environment variables:
DATABASE_NAME: Your D1 database name.DATABASE_ID: Your D1 database ID.COOKIES_SECRET: A secret used to sign cookies.EMAIL_DOMAIN: Your email domain, e.g.example.com,example.net.TURNSTILE_KEY: Your Turnstile site key (optional).TURNSTILE_SECRET: Your Turnstile secret key (optional).PASSWORD: Site access password (optional).API_RATE_LIMIT_PER_MINUTE: API rate limit per minute (optional, default 100).SHOW_AFF: Show promotional popup and link (optional,trueto enable, hidden by default).
- Discord: https://discord.gg/d68kWCBDEs
GNU General Public License v3.0