使用 Namecheap 电子邮件发送 Nodemailer 电子邮件

Send Nodemailer e-mail with Namecheap email

我已成功将 Gmail 帐户连接到 Xoauth,但我最近获得了一个 Namecheap privateemail 帐户,但我一直不知道如何设置它。这是我的代码:

var smtp = nodemailer.createTransport({
    host: 'mail.privateemail.com',
    port: 25,
    auth: {
        user: 'contact@myemail.com',
        pass: 'mypassword'
    }
});

我看到 this question 并尝试了所有其他端口号。

可能是安全连接,在这种情况下端口应为 465

465 port for SSL, 25 or 26 for TLS/STARTTLS

根据截至 2017 年 11 月 7 日的 Namecheap 支持网站 - 通过 Namecheap 私人电子邮件服务器发送消息的配置:

Outgoing server (SMTP): port 465 for SSL, port 587 for TLS/STARTTLS

Outgoing server authentication should be switched on,
SPA (secure password authentication) must be disabled.