我在家中有一個靜態IP的服務器,我爲自己的網頁提供了一個域,並且一切正常。如何使用郵件服務器和nodejs從我的服務器發送電子郵件
在我的網頁上,您可以通過電子郵件和密碼註冊。當您註冊名爲nodemailer的節點模塊時,會從Google帳戶發送電子郵件,問題在於Google帳戶具有已發送電子郵件的限制。
所以我需要將nodemailer模塊連接到我自己家中的服務器。
我在谷歌搜索,但沒有類似的答案。
如何使用postfix與nodejs?
或如何使用haraka模塊nodemailer
https://github.com/baudehlo/Haraka
所以我重複我的問題,我需要從我的服務器發送電子郵件至,在我的網站註冊的任何電子郵件用戶。
例如...
用戶[email protected]在我的網站進行註冊
nodemailer配置...
exports.newRegistration=function(parametros,callback)
{
var mailOptions =
{
from: "<[email protected]>",//my email
to: parametros.useremail,//user email
subject: 'Welcome '+parametros.useremail+'.',
html: '<br><b>Hello</b><br>'+ // html
};
var smtpTransport = nodemailer.createTransport("SMTP",
{
service: "Gmail",
secureConnection: true,
auth:
{
user: "[email protected]",
pass: "7ftera359c28a",
},
});
smtpTransport.sendMail(mailOptions, function(err, response)
{
if(err)
{
smtpTransport.close();
console.warn(err);
return callback(err,null);
}else{
smtpTransport.close();
return callback(null,response);
}
});
}
電子郵件發送OK,但它有一個限制每天。
,所以我需要使用電子郵件服務器發送我的電子郵件沒有限制.... TNX
EDIT 2
我安裝與mailutils apt-get的
,現在我嘗試
mail [email protected]
Cc: // press enter
Subject: Welcome
Hello Mail.
// Ctrl+D
此電子郵件發送到我的郵箱,我在垃圾郵件收到一封電子郵件,從[email protected]發送
因此,後綴是工作,但我仍然無法發送帶有emailjs或nodemailer電子郵件...
當我嘗試發送電子郵件與電子郵件或nodemailer我得到這個
smtp: '535 5.7.8 Error: authentication failed: generic failure\n'
我在搜索谷歌的錯誤,是和auth登錄錯誤,我無法登錄到系統。 所以我儘量通過telnet
telnet localhost 25
ehlo localhost
250-mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail to: [email protected]
501 5.5.4 Syntax: MAIL FROM:<address>
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
451 4.3.0 <[email protected]>: Temporary lookup failure
data
554 5.5.1 Error: no valid recipients
AUTH LOGIN
503 5.5.1 Error: MAIL transaction in progress
我再試
220 mydomain.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
UbuntuUser
535 5.7.8 Error: authentication failed: another step is needed in authentication
,並再次以root
220 mydomain.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-mydomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
root
334 UGFzc3dvcmQ6
rootPassword
535 5.7.8 Error: authentication failed: another step is needed in authentication
這是日誌文件
Jun 20 15:50:16 myname postfix/smtpd[12528]: warning: localhost[127.0.0.1]: SASL login authentication failed: another step is needed in authentication
,就是這樣。親們在哪裏在這個咩?
好吧,我覺得這是即時尋找....我會在這一刻 – andrescabana86
想我有一個錯誤:{[錯誤:authorization.failed] 代碼:3, 以前: {[錯誤:對命令'N2Z0ZXJhMzU5YzI4YQ =='錯誤的響應' 代碼:2, smtp:'535 5.7.8錯誤:認證失敗:通用故障\ n'}, smtp:undefined} – andrescabana86