I’m building a contact form that should email the submitted data to a Gmail address but it’s not working properly. When users fill out the form and hit submit, nothing gets sent to the email account. I’ve been trying to figure out what’s wrong with my setup but can’t seem to get it right.
Yeah, this is super common. SMTP.js has major limitations and Gmail blocks most attempts like this for security. Plus you’re exposing your credentials in frontend code - that’s a massive security hole.
I hit this same wall a few months back building a client portal. Wasted hours messing with SMTP configs before I realized I had it backwards.
You need a backend service handling the emails. Latenode fixes this without any server code. Just create a workflow that catches form data via webhook, then sends emails through a real email service.
Here’s the fix:
Ditch all the SMTP.js code
Set up a Latenode workflow with webhook trigger
Add email node connecting to Gmail or whatever provider
Change your form to POST to the webhook URL
Keeps credentials secure and emails actually go through. You can even add auto-responses or save form data to a database.
Takes maybe 10 minutes to setup and actually works. Way better than wrestling with client-side email sending.
Had this exact issue last year with my portfolio site. Gmail’s been blocking SMTP.js connections completely since they updated security policies. Even with proper auth, emails get rejected at server level. Your code looks fine - you’re just fighting Gmail’s paranoia about browser-based SMTP requests. I wasted weeks troubleshooting before realizing it wasn’t my setup that was broken. Switch to EmailJS instead. It handles server-side stuff and connects directly with Gmail without exposing credentials. Just register your email service, grab an API key, and swap out your JavaScript for their send function. Takes 15 minutes to migrate and actually delivers reliably.
check your gmail spam folder first - most contact form emails land there. also, gmail needs app passwords now instead of regular ones, so that’s probably why it’s failing. generate one in your google account security settings.