Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用meteor中的用户帐户、帐户密码发送验证电子邮件_Meteor_Meteor Accounts - Fatal编程技术网

如何使用meteor中的用户帐户、帐户密码发送验证电子邮件

如何使用meteor中的用户帐户、帐户密码发送验证电子邮件,meteor,meteor-accounts,Meteor,Meteor Accounts,一旦用户在我的应用程序中注册,我将尝试设置电子邮件验证,但我收到“内部服务器错误” 这是我创建注册表单的代码 <template name="LoginModal"> {{#if $not currentUser }} {{> atForm}} {{/if}} </template> //code inside the client folder to configure email verification Ac

一旦用户在我的应用程序中注册,我将尝试设置电子邮件验证,但我收到“内部服务器错误”

这是我创建注册表单的代码

 <template name="LoginModal">

    {{#if $not currentUser }}

        {{> atForm}}



   {{/if}}
  </template>
//code inside the client folder to configure email verification
   AccountsTemplates.configure({
   confirmPassword:false,
   termsUrl:'terms-of-use',
   privacyUrl:'privacy',
   sendVerificationEmail: true,
   enforceEmailVerification:true,

  forbidClientAccountCreation: true

  });

//Here is my route to load the signup form
 Router.route('/admin/addUser',{

     action: function () {
    BlazeLayout.render('master_layout',       
     {body:'LoginModal',dashboard:'UserDashboard',pageHeader:'AddUserHeader'});
  }
});
 //No any other routes for sign up has been configured.

{{#如果$not currentUser}
{{>atForm}
{{/if}
//客户端文件夹中用于配置电子邮件验证的代码
AccountsTemplates.configure({
确认密码:false,
termsUrl:“使用条款”,
privacyUrl:“隐私”,
sendVerificationEmail:true,
强制执行验证:正确,
禁止ClientAccountCreation:true
});
//这是我加载注册表单的路径
Router.route(“/admin/addUser”{
行动:功能(){
BlazeLayout.render('master_layout',
{body:'LoginModal',dashboard:'UserDashboard',pageHeader:'AddUserHeader'});
}
});
//尚未配置任何其他用于注册的路由。
//我收到的错误

(Mail not sent; to enable sending, set the MAIL_URL environment variable.)
I20170311-20:56:01.885(5.5)? MIME-Version: 1.0
I20170311-20:56:01.886(5.5)? Date: Sat, 11 Mar 2017 15:26:01 +0000
 I20170311-20:56:01.887(5.5)? From: "Meteor Accounts" <no-reply@meteor.com>
(邮件未发送;要启用发送,请设置Mail\u URL环境变量。)
I20170311-20:56:01.885(5.5)?MIME版本:1.0
I20170311-20:56:01.886(5.5)?日期:2017年3月11日星期六15:26:01+0000
I20170311-20:56:01.887(5.5)?来自:“流星帐户”
如何设置此设置以向创建的用户的电子邮件发送电子邮件。我应将发件人的电子邮件地址写入何处?


你发布的代码看起来不错。。您能否显示您如何配置路由的代码?试着评论一下,看看问题何时消失。如果你想比较的话,我正在使用AccountsTemplates。我现在在户外。我一到家就会发布代码。是否有必要在代码中的某个地方包含发件人的电子邮件地址?我在任何地方都没有这样做,所以我想知道如何发送tge电子邮件…AccountsTemplates处理所有这些。你需要的是一个url,否则它会在服务器日志(终端)上打印电子邮件。@mutdmour谢谢..我用路由代码编辑了我的问题。希望你能找到错误。我对代码做了一些更改。现在显示了一个新的错误。我在问题中添加了它。我如何设置url?我复制了代码并粘贴到服务器文件夹中的一个文件中。然后我尝试注册一个用户。然后我收到了此错误“调用方法'ATCreateUserServer'时出现异常”AuthError:无效登录-535 5.7.0 Mailgun不喜欢您的登录名或密码”这是“发件人”收到电子邮件时的地址。你注册邮枪了吗?此url适用于在mailgun上拥有帐户的开发人员。虽然这个代码片段可以解决这个问题,但它确实有助于提高文章的质量。记住,你是在为将来的读者回答这个问题,那些人可能不知道你的代码建议的原因。谢谢。我的gmail是dileka。14@cse.mrt.ac.lk. 我想不出要填写的用户名。我注册了mailgun,这很有效。谢谢你的建议。
Meteor.startup(function () {
  process.env.MAIL_URL = 'smtp://postmaster%40meteorize.mailgun.org:YOURPASSWORD@smtp.mailgun.org:587';
});