Contact Form Email Setup For Students (Resend, Nodemailer, Log)
A practical low-cost setup that still works across multiple hosts

March 23, 2026
7 min read
Contact Form Email Setup For Students
If you are a student and you do not have a domain yet, this setup keeps your contact form usable without forcing paid tools from day one.
The app now uses this fallback chain:
- Resend
- Nodemailer
- Logging-only fallback
That means your contact form will not hard-fail if one provider is missing.
Why this approach
- Works across multiple hosts.
- Lets you start free.
- Gives a gradual path to production reliability.
Environment Variables
Add this to .env.local for local testing.
# auto | resend | nodemailer | log
EMAIL_PROVIDER=auto
# Shared
CONTACT_FROM_EMAIL=contact@yourdomain.com
CONTACT_TO_EMAIL=your_inbox@gmail.com
# Resend
RESEND_API_KEY=re_xxx
# Nodemailer (Gmail fallback)
EMAIL_USER=yourgmail@gmail.com
EMAIL_PASS=your_gmail_app_password
# Optional custom SMTP
# SMTP_HOST=smtp.example.com
# SMTP_PORT=587
# SMTP_SECURE=false
What if I have no domain?
You are still fine.
Option A (fastest, free): Nodemailer with Gmail
Use:
EMAIL_PROVIDER=nodemailerEMAIL_USER=<your gmail>EMAIL_PASS=<gmail app password>CONTACT_TO_EMAIL=<your gmail>
For CONTACT_FROM_EMAIL, you can also use your Gmail for this mode.
Option B (works even without providers): Logging mode
Use:
EMAIL_PROVIDER=log
This will accept form submissions and print payloads to logs. Useful for demos and early development.
Option C (best long-term): Resend with your own domain
Use Resend once you get a domain, then set CONTACT_FROM_EMAIL to a verified sender on that domain.
Host compatibility notes
- Vercel: Resend and Nodemailer are both workable.
- Netlify: Resend and Nodemailer are both workable.
- Cloudflare runtime: Resend and log mode are safest. Nodemailer may not be supported there.
Debugging checklist
- Submit contact form once and check API response for
providerandattempts. - If provider is
log, inspect deployment logs for payload output. - If Nodemailer fails with Gmail, verify you are using an app password, not your normal password.
- If Resend fails, verify
RESEND_API_KEY, sender/domain verification, andCONTACT_FROM_EMAIL.
Cheap upgrade path
- Start with
logwhile building features. - Move to Gmail Nodemailer for real email without buying domain yet.
- Buy a low-cost domain when ready.
- Switch to Resend for better deliverability and Cloudflare compatibility.
Build first, optimize later.