我设置了EMAIL_URL
process.env.MAIL_URL="smtp://xx%40gmail.com:yyy@smtp.gmail.com:465"
这可以找到
Email.send({
to: 'a@exmaple.com',
from: 'b@exmaple.com',
subject: 'test',
text: 'some text'
});
然而这失败了
Accounts.config({
sendVerificationEmail: true
})
or
Accounts.sendVerificationEmail(userId,email)
给我错误
调用方法'createUser'时出现异常RecipientError:无法发送邮件 - 所有收件人都被拒绝
at Object.Future.wait(.meteor \ tools \ dc9fb5197a \ lib \ node_modules \ fibers \ future.js:326:15)
at smtpSend(packages / email / email.js:91)
at Object.Email.send(packages / email / email.js:152)
at Object.Accounts.sendVerificationEmail(packages / accounts-password / password_server.js:571)
at packages / accounts-password / password_server.js:692
在tryLoginMethod(packages / accounts-base / accounts_server.js:171)
at Object.Accounts._loginMethod(packages / accounts-base / accounts_server.js:287)
在Meteor.methods.createUser(packages / accounts-password / password_server.js:668)
at maybeAuditArgumentChecks(packages / livedata / livedata_server.js:1487)
at packages / livedata / livedata_server.js:643
在SMTPClient._actionRCPT(.meteor \ packages \ email \ a59237d5f0 \ npm \ node_modules \ simplesmtp \ lib \ client.js:909:27)
在SMTPClient._onData(.meteor \ packages \ email \ a59237d5f0 \ npm \ node_modules \ simplesmtp \ lib \ client.js:329:29)
在CleartextStream.emit(events.js:95:17)
在CleartextStream。 (_stream_readable.js:748:14)
在CleartextStream.emit(events.js:92:17)
在emitReadable_(_ stream_readable.js:410:10)
at _stream_readable.js:403:7
at process._tickCallback(node.js:419:13)
非常感谢任何帮助!
答案 0 :(得分:3)
我通过在服务器代码中添加以下内容来修复此问题:
Accounts.emailTemplates.from = "myemailaddress@example.com";
我不知道为什么这很重要,因为我已经用我的用户名正确设置了MAIL_URL,但确实如此! :)