I have deployed my Next.js project on vercel for free. I have also used little bit backend in this project just to transfer mails using Nodemailer. I have not integrate any database. I just transfer data to mail through Nodemailer. But the frontend is running fine but the backend is not working.
1 Like
Hello,
I see you’re trying to send emails using Nodemailer with Gmail from your Vercel deployment. There are a few reasons why this might not be working:
Common Issues with Email on Vercel
- Vercel Functions Limitations: Vercel recommends using third-party mail services rather than relying on the outgoing SMTP connection of your Vercel Function .
- Gmail Authentication: Gmail’s security policies often block “less secure apps” from sending emails with just a password. You need to use an App Password instead.
- Function Timeouts: Vercel Functions have execution time limits, and email sending might time out if the upstream service (Gmail) is slow to respond .
Recommended Solution
The best approach is to use a dedicated email service provider. Vercel officially recommends these services :
1 Like
@sibghatullah295295 Vercel is serverless, so accessing the file system, etc. like a typical backend would probably won’t work. I know there are also problems using nodemailer
on Vercel (I’ve been through this on my website…).
Vercel has an article about sending emails that might help: