HHFSBRS/server/routes/mail.js

19 lines
436 B
JavaScript

const express = require('express');
const sendmail = require('sendmail')({silent: true});
var router = express.Router();
router.post('/', (req, res, _next) => {
sendmail({
from: 'surpise-box@jobbel.nl',
to: req.body.email,
subject: 'test sendmail',
html: 'Mail of test sendmail',
}, function(err, reply) {
if (err) res.json({result: err});
else res.json({result: reply});
});
});
module.exports = router;