• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
souravvmishra

souravvmishra

createemailapiv2

Public
Like
1
createemailapiv2
Home
Code
2
README.md
H
emailProxy.ts
Branches
1
Pull requests
Remixes
History
Environment variables
1
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/25/2025
Viewing readonly version of main branch: v5
View latest version
README.md

Email Proxy Val

This Val Town project creates an email proxy that receives emails and forwards them to your specified email address.

Setup

  1. 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
  2. Email Trigger:

    • The val is already configured with an email trigger
    • It will receive emails sent to the generated email address

How It Works

  1. Receives Email: The val receives any email sent to its generated email address
  2. Formats Forward: Creates a nicely formatted forwarded email with:
    • Original sender information
    • Original subject (prefixed with "[Forwarded]")
    • Original content (both text and HTML)
    • Timestamp
  3. Sends Forward: Sends the formatted email to your specified address
  4. Error Handling: If forwarding fails, sends you an error notification

Features

  • ✅ 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

Usage

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.

Environment Variables Required

  • FORWARD_TO_EMAIL: Your email address where forwarded emails should be sent

File Structure

  • emailProxy.ts: Main email proxy logic with email trigger
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.