integradted email engine

This commit is contained in:
rohittaware1997
2023-12-18 04:54:49 +00:00
parent beb65349b6
commit c97ff664d5
4 changed files with 240 additions and 17 deletions

View File

@ -1,12 +1,24 @@
// dbConfig.js
const mysql = require('mysql');
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
host: process.env.CLOUDRON_MAIL_SMTP_SERVER, // Replace with your email server host
port: process.env.CLOUDRON_MAIL_SMTP_PORT, // Replace with your email server port
secure: false, // false for non-SSL, true for SSL/TLS
auth: {
user: process.env.CLOUDRON_MAIL_SMTP_USERNAME, // Replace with your email username
pass: process.env.CLOUDRON_MAIL_SMTP_PASSWORD // Replace with your email password
},
});
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: '',
password: 'your_new_password1!Q',
database: 'community_rule',
});
// const mysql = require('mysql2');
// const connection = mysql.createConnection({
@ -21,4 +33,5 @@ connection.connect((err) => {
console.log('Connected to the database');
});
module.exports = connection;
module.exports = connection, transporter;