Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var email = request.query.email;
var subject = request.query.subject;
var message = request.query.message;
var responseMessage = "<p>Success!<br>" +
"You've sent the text: <br>"+
"email: "+email+"<br>"+
"subject: "+subject+"<br>"+
"message: "+message+"<br></p>";
response.send(responseMessage);
debugger;
//Send the info along to gmail to transmit the email using NodeMailer.
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: gmail_username,
pass: gmail_password
}
}, {
// default values for sendMail method
from: gmail_from,
//headers: {
// 'My-Awesome-Header': '123'
//}
});
transporter.sendMail({
to: email,
subject: subject,
text: message
function massMailer() {
var self = this;
transporter = nodemailer.createTransport("SMTP",{
host: 'smtp.gmail.com',
port: 587,
auth: {
user: '',
pass: ''
},
tls: {rejectUnauthorized: false},
debug:true
});
// Fetch all the emails from database and push it in listofemails
self.invokeOperation();
};
function sendEmail(user, html) {
const { gmail } = require('./keys')
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'summariesio@gmail.com',
pass: gmail
}
})
const mailOptions = {
list: {
unsubscribe: {
/* url: add url for users to come and unsubscribe
might be a link to remove themselves from the firestore database
*/
comment: 'Unsubscribe from this mailing list'
}
},
var mailer = require('nodemailer');
var stat = require('node-static');
var d = require('../lib/durable');
var transport = mailer.createTransport('SMTP',{
service: 'Gmail',
auth: {
user: 'durablejs@gmail.com',
pass: 'durablepass'
}
});
d.run({
approve1: {
r1: {
when: { $gt: { amount: 1000 } },
run: function(s) { console.log('denied'); }
},
r2: {
when: { $lte: { amount: 1000 } },
run: function(s) { console.log('approved'); }
exports.sendEmail = emailData => {
const transporter = nodeMailer.createTransport({
host: "smtp.gmail.com",
port: 587,
secure: false,
requireTLS: true,
auth: {
user: "masterjupiter2015@gmail.com",
pass: "kshzlmomlthllktq"
}
});
return transporter
.sendMail(emailData)
.then(info => console.log(`Message sent: ${info.response}`))
.catch(err => console.log(`Problem sending email: ${err}`));
};
const admin = require('firebase-admin');
const functions = require('firebase-functions');
const nodemailer = require('nodemailer');
admin.initializeApp(functions.config().firebase);
var db = admin.firestore();
var FieldValue = require('firebase-admin').firestore.FieldValue;
const gmailEmail = functions.config().gmail.email;
const gmailPassword = functions.config().gmail.password;
const mailTransport = nodemailer.createTransport({
service: 'gmail',
auth: {
user: gmailEmail,
pass: gmailPassword
}
});
const APP_NAME = 'ScoutingFRC';
exports.userCreate = functions.auth.user().onCreate(event => {
const user = event.data;
const displayName = user.displayName;
const uid = user.uid;
const email = user.email;
console.log('new user Created:'+ displayName+' UID: '+uid);
var ref = db.collection('users').doc(uid);
}
}
console.error(`\nCRASH: ${stack}\n`);
let out = require('fs').createWriteStream(logPath, {'flags': 'a'});
out.on("open", fd => {
out.write(`\n${stack}\n`);
out.end();
}).on("error", err => {
console.error(`\nSUBCRASH: ${err.stack}\n`);
});
if (Config.crashguardemail && ((datenow - lastCrashLog) > CRASH_EMAIL_THROTTLE)) {
lastCrashLog = datenow;
try {
if (!transport) transport = require('nodemailer').createTransport(Config.crashguardemail.options);
} catch (e) {
console.error(`Could not start nodemailer - try \`npm install\` if you want to use it`);
}
if (transport) {
transport.sendMail({
from: Config.crashguardemail.from,
to: Config.crashguardemail.to,
subject: Config.crashguardemail.subject,
text: `${description} crashed ${exports.hadException ? "again " : ""}with this stack trace:\n${stack}`,
}, err => {
if (err) console.error(`Error sending email: ${err}`);
});
}
}
exports.hadException = true;
if (transport === "test") {
return nodemailer.createTransport ({
name: 'testsend',
version: '1',
send: function(data, callback) {
callback();
}
});
}
if (transport.plugin) {
var transPlugin = require (transport.plugin);
return nodemailer.createTransport (transPlugin (transport.config));
}
return nodemailer.createTransport (transport);
}
function initialize(config) {
queue_dir = config.queue;
sent_dir = config.sent;
from = config.from;
transport = nodemailer.createTransport({
host: config.server,
port: config.port,
secure: config.is_secured,
tls: {rejectUnauthorized: config.verify_ssl_cert},
auth: {
user: config.user,
pass: config.password
}
});
}