Contact Form Email Setup For Students (Resend, Nodemailer, Log)

A practical low-cost setup that still works across multiple hosts

Lord Junn
Lord Junn
March 23, 2026
7 min read
Contact Form Email Setup For Students (Resend, Nodemailer, Log)

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:

  1. Resend
  2. Nodemailer
  3. 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=nodemailer
  • EMAIL_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

  1. Submit contact form once and check API response for provider and attempts.
  2. If provider is log, inspect deployment logs for payload output.
  3. If Nodemailer fails with Gmail, verify you are using an app password, not your normal password.
  4. If Resend fails, verify RESEND_API_KEY, sender/domain verification, and CONTACT_FROM_EMAIL.

Cheap upgrade path

  1. Start with log while building features.
  2. Move to Gmail Nodemailer for real email without buying domain yet.
  3. Buy a low-cost domain when ready.
  4. Switch to Resend for better deliverability and Cloudflare compatibility.

Build first, optimize later.