簡體   English   中英

使用 nodemailer 從托管在 hostmonster 上的 SMTP 服務器發送的電子郵件未發送給收件人

[英]Emails sent from SMTP server hosted on hostmonster using nodemailer are not delivering to the recipients

我們的 SMTP 服務器托管在 hostmonster 上。 我們正在使用 nodemailer 從我們的應用程序向用戶發送電子郵件。 我面臨的問題是,我從 SMTP 服務器收到 250 OK 響應,但電子郵件沒有發送給用戶。 我正在使用 hostmonster 提供的確切 email 配置。 我們的 nodemailer 配置是:

var mailTransporter = nodemailer.createTransport({
host: "mail.domain.com",
port: 456,
secure: true,
auth: {
  user: "account@domain.com",
  pass: "password"
},
tls: {
        rejectUnauthorized: false,
     },
});

我得到的回應是:

{ accepted: [ 'email@domain.com' ],
  rejected: [],
  envelopeTime: 899,
  messageTime: 315,
  messageSize: 3464,
  response: '250 OK id="someid"',
  envelope:
   { from: 'account@domain.com',
     to: [ 'email@domain.com' ] },
  messageId: '<some-id@domain.com>' }

我希望 email 能夠交付給用戶(收件人),但它沒有交付。 你們中的任何人都可以驗證我的 nodemailer 配置嗎? 我的 nodemailer 配置有問題嗎? 或者hostmonster方面有什么問題嗎?

結果,我需要在 createTransport() 配置中添加“名稱”選項。 該名稱應該是域,即“www.domain.com”。

var mailTransporter = nodemailer.createTransport({
name: "www.domain.com",
host: "mail.domain.com",
port: 456,
secure: true,
auth: {
  user: "account@domain.com",
  pass: "password"
},
tls: {
        rejectUnauthorized: false,
     },
});

參考: https://github.com/nodemailer/nodemailer/issues/677

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM