createemailapiv2
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v4View latest version
This Val Town project creates an email proxy that receives emails and forwards them to your specified email address.
-
Set Environment Variable:
- Go to your Val Town settings and add an environment variable named
FORWARD_TO_EMAIL - Set its value to your email address where you want forwarded emails to be sent
- Go to your Val Town settings and add an environment variable named
-
Email Trigger:
- The val is already configured with an email trigger
- It will receive emails sent to the generated email address
- Receives Email: The val receives any email sent to its generated email address
- Formats Forward: Creates a nicely formatted forwarded email with:
- Original sender information
- Original subject (prefixed with "[Forwarded]")
- Original content (both text and HTML)
- Timestamp
- Sends Forward: Sends the formatted email to your specified address
- Error Handling: If forwarding fails, sends you an error notification
- ✅ Preserves original email content (text and HTML)
- ✅ Shows original sender and recipient information
- ✅ Adds clear forwarding headers
- ✅ Error notifications if forwarding fails
- ✅ Clean HTML formatting for better readability
Once set up, simply send emails to the generated email address for this val, and they will be automatically forwarded to your configured email address.
FORWARD_TO_EMAIL: Your email address where forwarded emails should be sent
emailProxy.ts: Main email proxy logic with email trigger