Commit 90d53805 authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parents 9770f8b4 0cac4453
...@@ -15,22 +15,28 @@ const sendEmail = (request, response) => { ...@@ -15,22 +15,28 @@ const sendEmail = (request, response) => {
` `
let transporter = nodemailer.createTransport({ let transporter = nodemailer.createTransport({
host: 'smtp.gmail.com', host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: { auth: {
user: 'vdocmanagement@gmail.com', user: 'vdocmanagement@gmail.com',
pass: 'docmgmt123' pass: 'docmgmt123'
}, },
//proxy: 'http://10.194.194.2:8080' // proxy: 'http://10.194.194.2:8080'
}) })
let maillist = [
emailsend
]
maillist.forEach(function (to, i, array) {
let mailOptions = { let mailOptions = {
from: 'vdocmanagement@gmail.com', from: 'vdocmanagement@gmail.com',
to: emailsend,
cc: emailcc, cc: emailcc,
subject: subject, subject: subject,
text: message, text: message,
html: htmlEmail html: htmlEmail
} }
mailOptions.to = to;
transporter.sendMail(mailOptions, (error, info) => { transporter.sendMail(mailOptions, (error, info) => {
if (err) { if (err) {
throw error throw error
...@@ -40,6 +46,7 @@ const sendEmail = (request, response) => { ...@@ -40,6 +46,7 @@ const sendEmail = (request, response) => {
response.status(200).json({ status: 'success', message: 'Email has been sent' }) response.status(200).json({ status: 'success', message: 'Email has been sent' })
}) })
}) })
})
} }
const getDocument = (request, response) => { const getDocument = (request, response) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment