为什么我的带有帐户包的Meteor应用程序没有发送验证邮件?

Nea*_*int 12 user-accounts email-verification meteor meteorite

我正在制作一个流星应用程序,我添加了mrt帐户密码包以及mrt accounts-ui-bootstrap-dropdown.

我添加了登录按钮,以便用户可以创建一个帐户,并且工作得很好.我正在使用所有默认值.

在服务器上我有代码:

Accounts.config({
  sendVerificationEmail: true,
  forbidClientAccountCreation: false
});
Run Code Online (Sandbox Code Playgroud)

当我创建一个新帐户时,服务器控制台会打印:

I20130821-18:31:42.105(-4)? ====== BEGIN MAIL #0 ======
I20130821-18:31:42.106(-4)? MIME-Version: 1.0
I20130821-18:31:42.107(-4)? From: "Meteor Accounts" <no-reply@meteor.com>
I20130821-18:31:42.108(-4)? To: hidden@hidden.edu
I20130821-18:31:42.108(-4)? Subject: How to verify email address on localhost:3000
I20130821-18:31:42.109(-4)? Content-Type: text/plain; charset=utf-8
I20130821-18:31:42.109(-4)? Content-Transfer-Encoding: quoted-printable
I20130821-18:31:42.109(-4)? Hello,
I20130821-18:31:42.110(-4)? To verify your account email, simply click the link below.
I20130821-18:31:42.110(-4)? http://localhost:3000/#/verify-email/C2vJeaDLeMkkWmcRY
I20130821-18:31:42.111(-4)? Thanks.
I20130821-18:31:42.111(-4)? ====== END MAIL #0 ======
Run Code Online (Sandbox Code Playgroud)

所以看起来它从服务器发送电子邮件但我从未在收件箱中收到验证邮件.我尝试过多次,已经过了一个多小时!我还查看了垃圾邮件文件夹.是什么赋予了?

提前致谢

Hub*_* OG 18

请参见此处:http://docs.meteor.com/#email

如果未设置MAIL_URL(例如,在本地运行应用程序时),则Email.send将消息输出到标准输出

像Meteor这样的Web服务器不能自己发送电子邮件,他们需要一台SMTP服务器才能这样做.您需要设置一个并使用MAIL_URL变量进行设置.


Jul*_*nec 14

要配置MAIL_URL,请不要忘记添加核心电子邮件包:

meteor add email
Run Code Online (Sandbox Code Playgroud)

然后,服务器端:

// server/smtp.js
Meteor.startup(function () {
  smtp = {
    username: 'your_username',   // eg: server@gentlenode.com
    password: 'your_password',   // eg: 3eeP1gtizk5eziohfervU
    server:   'smtp.gmail.com',  // eg: mail.gandi.net
    port: 25
  }

  process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
});
Run Code Online (Sandbox Code Playgroud)

阅读更多:使用Meteor帐户验证电子邮件.