【问题标题】:nodemailer: message queued but not sentnodemailer:消息已排队但未发送
【发布时间】:2021-07-04 20:23:16
【问题描述】:

我正在使用 nodemailer 使用自定义 SMTP 服务器发送电子邮件。

let transporter = nodemailer.createTransport({
  host: 'my.smtp.host',
  port: 587,
  secure: false,
  auth: {
    user: 'user',
    pass: 'password',
  },
  debug: true,
  logger: true
})

let info = await transporter.sendMail({
  from: from,
  to: to,
  subject: subject,
  text: content,
  html: content,
  cc: cc,
  bcc: bcc,
})

下面是sendMail的结果。

{
  accepted: [
    'to@to.com'
  ],
  rejected: [],
  envelopeTime: 39,
  messageTime: 49,
  messageSize: 1730,
  response: '250 2.0.0 Ok: queued as 5513B432BE6',
  envelope: {
    from: 'from@from.com',
    to: [
      'to@to.com'
    ]
  },
  messageId: '<274421c8-1abd-4973-dd8e-f57285b46a70@from.com>'
}

以下是日志消息。

...
[2021-06-09 19:00:21] INFO  [StdWZWNkAto] <1730 bytes encoded mime message (source size 1693 bytes)>
[2021-06-09 19:00:21] DEBUG [StdWZWNkAto] S: 250 2.0.0 Ok: queued as 5513B432BE6
[2021-06-09 19:00:21] DEBUG [StdWZWNkAto] Closing connection to the server using "end"

我已经用其他工具测试了这个 SMTP 服务器,它工作正常。 怎么了?

请帮帮我。

【问题讨论】:

    标签: email smtp nodemailer


    【解决方案1】:

    嗯,这意味着 nodemailer 成功发送了电子邮件,现在它在你的自定义 SMTP 服务器的队列中,所以你必须处理它。例如,sendmail 允许通过mailq 命令查看队列并通过sendmail -q 重新发送(或sendmail -q -v 以获取更多信息)。如果您需要更多详细信息,您应该提供有关您的 SMTP 服务器的信息。

    【讨论】:

      猜你喜欢
      • 2021-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-18
      • 2014-11-13
      • 2019-02-27
      • 2014-05-12
      • 1970-01-01
      相关资源
      最近更新 更多