当我在Node JS中发送电子邮件时收到无效错误

时间:2019-07-15 18:45:44

标签: node.js nodemailer

当我在Node JS中发送电子邮件时收到无效错误
 我正在尝试使用nodemail发送邮件,但出现此错误

{
"error": {
"code": "EENVELOPE",
"command": "API"
},
"results": {
"fieldCount": 0,
"affectedRows": 1,
"insertId": 0,
"serverStatus": 2,
"warningCount": 0,
"message": "(Rows matched: 1  Changed: 0  Warnings: 0",
"protocol41": true,
"changedRows": 0
},

我的代码是

"requesterUpdateMail": {
"from": ""Intake Request" <mpo.info.analytics@xyz.com>",
"mailList": [
"Sudheer.Reddy@xyz.com",
"Sudheer.Reddy@xyz.com",
],
"subject": "Intake ID: 276 - UPDATE",
"text": "There has been an update to your intake request ID: 276 - testing",
"html": "<p>Status: Backlog</p><br/><p>Triage Notes: Testing Email notifications</p><br/>"
},
"priorityResults": {
"fieldCount": 0,
"affectedRows": 6,
"insertId": 0,
"serverStatus": 34,
"warningCount": 0,
"message": "(Rows matched: 6  Changed: 6  Warnings: 0",
"protocol41": true,
"changedRows": 6
},
"level": "error",
"message": "Failure to send requester status update email"
}

function requesterEmail(insertId, record, statusUpdate, status) {
  const emailInfo = {
    from: '"Intake Request" <mpo.info.analytics@xyz.com>',
    mailList: [
      record.submitted_by_email,
      record.requested_for_email,
      "faddah.wolf@xyz.com"
    ],
    subject: "Your intake request (ID: " + insertId + ") has been submitted.", // Subject line
    text: "Your request will be reviewed shortly, and we will follow up ASAP.",
    html: "<h4>Issue/Opportunity:</h4>" +
      "<p>" +
      record.opportunity +
      "</p>" +
      "<p>Your request (ID: " +
      insertId +
      ") will be reviewed shortly, and we will follow up ASAP.  Please reply to this email with any additional questions or supporting documents.</p>"
  };

  if (statusUpdate) {
    emailInfo.subject = "Intake ID: " + insertId + " - UPDATE";
    emailInfo.text = "There has been an update to your intake request ID: " + insertId + " - " + record.opportunity + "";
    emailInfo.html = "<p>Status: " +  status + "</p><br/>";
    if (record.triage_notes) {
      emailInfo.html += "<p>Triage Notes: " + record.triage_notes + "</p><br/>";
    }
    if (record.prioritization_notes) {
      emailInfo.html += "<p>Prioritization Notes: " + record.prioritization_notes + "</p><br/>";
    }
  }

  emailInfo.mailList = emailInfo.mailList.filter(mailer => !!mailer);

  return emailInfo;
}

Config:Ubuntu 16.04 LTS / Nginx我正在尝试使用nodemail发送邮件,但是我有这个 当我在Node JS中发送电子邮件时收到无效错误 当我在Node JS中发送电子邮件时收到无效错误

0 个答案:

没有答案
相关问题