Working on some mail things
This commit is contained in:
parent
a0c1bd8a37
commit
55766610d0
@ -12,7 +12,7 @@ const transporter = nodemailer.createTransport({
|
||||
port: 587,
|
||||
secure: false, // upgrade later with STARTTLS
|
||||
auth: {
|
||||
user: "36995@leerling.heerenlanden.nl",
|
||||
user: "heerenlandencollege@gmail.com",
|
||||
pass: secret
|
||||
}
|
||||
});
|
||||
|
38
server/sendmail.js
Normal file
38
server/sendmail.js
Normal file
@ -0,0 +1,38 @@
|
||||
const nodemailer = require('nodemailer');
|
||||
const secret = require('./secret');
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: "smtp.gmail.com",
|
||||
port: 587,
|
||||
secure: false, // upgrade later with STARTTLS
|
||||
auth: {
|
||||
user: "heerenlandencollege@gmail.com",
|
||||
pass: secret
|
||||
}
|
||||
});
|
||||
|
||||
var mailOptions = {
|
||||
from: 'Surprise box team van Het Heerenlanden',
|
||||
to: 'aardtaart1@gmail.com',
|
||||
subject: `Aanvraag voor surprise box `,
|
||||
html: `
|
||||
<html>
|
||||
<body>
|
||||
<p>Beste ,</p>
|
||||
<p>
|
||||
Deze email is verzonden omdat u surprise box voor de kerstmarkt van Het Heerenlanden heeft aangevraagd.<br>
|
||||
Om uw aanvraag te bevestigen, moet u om de volgende link klikken:<br>
|
||||
<a href='http://localhost:3000/mail/validate/'>http://localhost:3000/mail/validate/</a><br>
|
||||
Deze link verloopt na één uur.
|
||||
</p>
|
||||
|
||||
<p>Met vriendelijk groet,<br> het surprise box team van Het Heerenlanden</p>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
};
|
||||
|
||||
transporter.sendMail(mailOptions, function(error, info){
|
||||
if (error) console.log(error)
|
||||
console.log(info)
|
||||
});
|
Loading…
Reference in New Issue
Block a user