2015-10-26 29 views
0

我正在节点js和jquery上创建一个web应用程序。在这个应用程序中,我使用Nodemailer在使用创建帐户时发送电子邮件。现在我正在使用如何使用nodemailer从节点发送邮件js应用程序

var transport = nodemailer.createTransport("SMTP", { 
    service: "Gmail", 
    auth: { 
     user: "[email protected]", 
     pass: "abcpws" 
    } 
}); 

这很好。但是现在我想更改发件人电子邮件,如[email protected]。现在我的电子邮件是在(hostgator)上创建的[email protected]

我该怎么做才能使用此邮件发送邮件。

回答

0

您需要配置与SMTP参数转运:

var transport = nodemailer.createTransport({ 
    host  : 'mail.domain.com', 
    port  : 26, 
    ignoreTLS: true, 
    tls :{rejectUnauthorized: false}, 
    secure :false, 
    auth: { 
     user: '[email protected]', 
     pass: "123", 
    } 
}); 
相关问题