我正在使用以下内容发送适用于本地主机但不适用于我的服务器的电子邮件。
// server
Meteor.startup(function () {
process.env.MAIL_URL="smtp://uername%40gmail.com:password@smtp.gmail.com:465/";
});
我的日志中出现以下错误(谷歌似乎出于某种原因阻止了它,有没有办法阻止它?
[162.243.52.235] 534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 l10sm1017845qae.41 - gsmtp
at SMTPClient._actionAUTHComplete (/opt/meteor/app/programs/server/npm/email/main/node_modules/simplesmtp/lib/client.js:826:23)
at SMTPClient._onData (/opt/meteor/app/programs/server/npm/email/main/node_modules/simplesmtp/lib/client.js:329:29)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at CleartextStream.<anonymous> (_stream_readable.js:746:14)
at CleartextStream.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at _stream_readable.js:401:7
at process._tickCallback (node.js:415:13)
这是我认为发送启动电子邮件发送的事件。我知道meteor现在设置为使用mailgun,有没有办法修改它只使用mailgun而不是没有process.env的meteor?
Template.forgotPassword.events({
'submit #forgotPasswordForm': function(e, t) {
e.preventDefault();
var forgotPasswordForm = $(e.currentTarget),
email = trimInput(forgotPasswordForm.find('#forgotPasswordEmail').val().toLowerCase());
if (isNotEmpty(email) && isEmail(email)) {
Accounts.forgotPassword({email: email}, function(err) {
if (err) {
if (err.message === 'User not found [403]') {
Session.set('alert', 'This email does not exist.');
} else {
Session.set('alert', 'We\'re sorry but something went wrong.');
}
} else {
Session.set('alert', 'Email Sent. Please check your mailbox to reset your password.');
}
});
}
return false;
},
'click #returnToSignIn': function(e, t) {
Session.set('showForgotPassword', null);
return false;
},
});
已安装的软件包