A Node.js Express API that integrates with disposablemail.com to generate temporary email addresses, including support for custom email names and inbox checking.
- Generate random disposable emails (
/getmail) - Generate custom emails by passing
namequery (/getmail?name=yourname) - Check email inbox messages (
/chkmail?mail=your_encoded_email) - Delete email by
mailand emailid(/delete?mail=testSoumya@xxx.xxx&id=1) - Fully serverless and deployable on Vercel
In my case base url is - https://temp-mail-peach.vercel.app
Generates a new disposable email.
name: Custom email name to register (e.g.,/getmail?name=soumyatest)
Returns JSON:
{
"email": "soumyatest@deliverydaily.org",
"password": null,
"session": "your-session-id"
}Checks inbox for a generated email.
mail: Email name encoded (e.g.,soumyatest%40deliverydaily.org)
Returns JSON inbox data from DisposableMail.
Delete a inboxed email for a specific mail.
mail: Email name encoded (e.g.,soumyatest%40deliverydaily.org)id: email id (e.g.,1)
return success or failed response.
This project is ready to deploy on Vercel.
- Push to GitHub
- Connect the repo to Vercel
- Vercel auto-detects the build using
vercel.json
{
"version": 2,
"builds": [
{
"src": "/index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
]
}This setup ensures that all routes (/getmail, /chkmail, etc.) are handled by the Express server.