VitaePro now sends an email alert to andrewgbaillie@hotmail.com whenever someone logs into the application.
To send emails through Gmail, you need to create an App Password (not your regular Gmail password):
- Go to your Google Account: https://myaccount.google.com/
- Navigate to Security
- Enable 2-Step Verification (if not already enabled)
- Go to App Passwords (search for it in the security page)
- Create a new app password:
- Select app: Mail
- Select device: Other (Custom name) → Enter "VitaePro"
- Google will generate a 16-character password
- Copy this password (you won't be able to see it again)
Open your .env file and update the email configuration:
# ============ EMAIL ALERTS ============
EMAIL_SERVICE=gmail
EMAIL_USER=your-actual-email@gmail.com
EMAIL_PASSWORD=your-16-character-app-password
ALERT_EMAIL=andrewgbaillie@hotmail.comReplace:
your-actual-email@gmail.comwith your Gmail addressyour-16-character-app-passwordwith the app password you generated
After updating the .env file, restart your server:
npm startYou should see: 📧 Email alerts configured in the console when the server starts.
- Log into your VitaePro application
- Check andrewgbaillie@hotmail.com for the alert email
- The email will contain:
- Username
- User ID
- Login timestamp
- Confirmation message
If you see ⚠️ Email alerts not configured, check:
- EMAIL_USER and EMAIL_PASSWORD are set in .env
- No extra spaces in the values
- The .env file is in the root directory
If configured but emails aren't arriving:
- Verify the app password is correct
- Check your Gmail account hasn't blocked the app
- Look for error messages in the server console
- Check spam folder in andrewgbaillie@hotmail.com
If you don't want to use Gmail, you can use other services:
Outlook/Hotmail:
EMAIL_SERVICE=hotmail
EMAIL_USER=your-email@outlook.com
EMAIL_PASSWORD=your-passwordCustom SMTP:
EMAIL_SERVICE=
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_USER=your-email@example.com
EMAIL_PASSWORD=your-passwordFor custom SMTP, you'll need to modify the nodemailer configuration in server.js.
- Never commit your .env file to version control
- Keep your app password secure
- The email is sent asynchronously so it won't slow down logins
- If email sending fails, the login will still succeed (fail-safe design)