Introduction
Zoho Mail provides secure SMTP servers that allow you to send emails from external applications. Using Node.js and Nodemailer, you can easily integrate Zoho Mail into your projects for automated emails, notifications, or contact forms. This guide focuses on Zoho India accounts (
.inPrerequisites
- Node.js installed
- A Zoho Mail account ()
@zohomail.in - Nodemailer library ()
npm install nodemailer - Optional: App-specific password if Two-Factor Authentication (2FA) is enabled
SMTP Configuration for Zoho India
For Personal/Free Accounts:
- SMTP Host:
smtp.zoho.in - SSL Port: (secure: true)
465 - TLS Port: (secure: false)
587 - Authentication: required
For Paid Domain Accounts:
- SMTP Host:
smtppro.zoho.in - Ports and security: same as above
Ensure your
email address matches your Zoho account exactly.user
Step 1: Install Nodemailer
bashnpm install nodemailer
Step 2: Configure Transporter
jsconst nodemailer = require('nodemailer'); const transporter = nodemailer.createTransport({ host: 'smtp.zoho.in', // Zoho India SMTP port: 465, // SSL port secure: true, // true for SSL auth: { user: 'your-email@zohomail.in', pass: 'your-app-password', // required if 2FA is enabled }, });
Step 3: Define Email Options
jsconst mailOptions = { from: '"Raiyan Hasan" <your-email@zohomail.in>', to: 'receiver@gmail.com', subject: 'Test Email via Zoho SMTP', text: 'This is a test email sent from Node.js using Nodemailer and Zoho Mail.', };
Step 4: Send Email
jstransporter.sendMail(mailOptions, (err, info) => { if (err) console.error('Error sending email:', err); else console.log('Email sent successfully:', info.response); });
Common Issues & Fixes
-
Authentication Failed (535):
- Use app-specific password if 2FA is enabled
- Ensure matches your
useremail address exactly.in
-
Port/Security Mismatch:
- SSL → port 465, secure: true
- TLS → port 587, secure: false
-
Relaying Disallowed:
- Ensure the “from” email matches your authenticated Zoho account
Conclusion
Sending emails from Node.js via Zoho Mail is straightforward with Nodemailer. Always use
.in

