A Node.js project demonstrating how email headers, sender identity, and HTML-based emails can be configured using Nodemailer. This project is intended strictly for educational, testing, and awareness purposes.
This project showcases how emails are sent programmatically using Gmail SMTP via Nodemailer. It highlights:
- Custom sender name & email address
- HTML email templates
- SMTP authentication using App Passwords
- How email headers appear to recipients
This project does NOT bypass Gmail security, SPF, DKIM, or DMARC protections. Modern email clients may flag such emails as spoofed or unverified.
- Node.js
- Nodemailer (v7.0.6)
- Gmail SMTP
fake-mail/
│── index.js
│── package.json
│── package-lock.json
git clone https://github.com/your-username/fake-mail.git
cd fake-mail
npm install
For security reasons, never hardcode credentials in production.
EMAIL_USER=yourgmail@gmail.com
EMAIL_PASS=your_app_password
🔑 Generate a Gmail App Password from Google Account → Security → App Passwords
Run the script using:
node index.js
If successful, you’ll see:
✅ Fake mail sent: <message-id>
- Custom From Name & Address
- Rich HTML email layout
- Date & time rendering inside email body
- Gmail SMTP authentication
- Email delivery logging
Example sender configuration (from the code):
from: '"ABC Technologies" <talent@abc.com>'
This project is created only for:
- Learning how SMTP works
- Understanding email headers
- Testing email formatting
- Security awareness & education
- Phishing
- Impersonation
- Fraud
- Misleading communications
The author is not responsible for misuse of this code.
- How Nodemailer handles SMTP transport
- Why email spoofing is unreliable due to SPF/DKIM/DMARC
- How email clients verify sender authenticity
- Secure handling of email credentials
- Add .env support using dotenv
- Email template separation
- Multiple recipient support
- Validation & error handling
- Logging with timestamps
Full-Stack Developer
- 🌐 Portfolio: https://www.hrsha.site/
- 🐙 GitHub: https://github.com/vermaharsha
- 💼 LinkedIn: https://linkedin.com/in/verma-harsha