sendemail.js 454 B

12345678910111213141516
  1. const express = require('express')
  2. const router = express.Router()
  3. const email = require('./email')
  4. router.post('/', async (req, res) => {
  5. let useremail = req.body.useremail
  6. let usermessage = req.body.usermessage
  7. let data = await email(useremail, usermessage)
  8. if(data != 'err' && data == 'success') {
  9. res.status(200).send('success')
  10. }else {
  11. res.status(201).send('服务器出错了')
  12. }
  13. })
  14. module.exports = router