2015-10-26 73 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", 
    } 
}); 
相關問題