mp/consumerWebsite/modules/nodemailer.js
newtbot c234aa3616 Add nodemailer configuration and console.log statement
Update formAJAX function to log data from the server
Add getUserByEmail and checkEmail functions
Update profile.ejs to require login
Update addSensorData function to emit new sensor data
Update api.css with styling changes
Update token route to generate and send token email
Update authChecker middleware to allow user and token routes
2024-01-27 04:52:02 +08:00

17 lines
436 B
JavaScript

const nodemailer = require("nodemailer");
const dotenv = require("dotenv");
const path = require('path')
require('dotenv').config({ path: path.resolve(__dirname, '../.env') })
//.env
let transporter = nodemailer.createTransport({
service: 'gmail',
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: process.env.euser,
pass: process.env.epass
},
});
module.exports = { transporter };