text: const nodemailer = require('nodemailer');
  const path = require("path");
  
  let transporter = nodemailer.createTransport({
      host: 'smtp.yeah.net',
      secureConnection: true,
      port: 465,
      secure: true,
      auth: {
          user: 'xiangguowen@yeah.net',
          pass: 'xgw668626'
      }
  });
  
  function sendMail(toUser, title, content) {
      // 设置邮件内容（谁发送什么给谁）
      let mailOption = {
          from: 'xiangguowen@yeah.net',
          to: toUser,
          subject: title,
          // text: '赶紧修复bug',  // plain text body 和下面html字段取其一
          html: content,
          // 下面是发送附件，不需要可注释
          attachments: [{
              filename: '错误报告.txt',
              content
          }
          ]
      };
  
      transporter.sendMail(mailOption).then(result => {
          console.log(`Message: ${result.message}`);
          console.log(`sent: ${result.response}`)
      })
  }
  
  module.exports = {
      sendMail
  }
  
  