Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/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
Email 限制meteor应用程序发送的电子邮件数量?_Email_Meteor - Fatal编程技术网

Email 限制meteor应用程序发送的电子邮件数量?

Email 限制meteor应用程序发送的电子邮件数量?,email,meteor,Email,Meteor,有人能告诉我如何限制meteor应用程序发送的电子邮件数量吗?我想防止我的应用程序受到垃圾邮件发送者的攻击 这是我的代码: /server/email.js文件: Meteor.methods({ sendEmail: function (text) { check([text], [String]); this.unblock(); Email.send({ to: 'x@y.com', from: 'y@z.com', subject: 'New

有人能告诉我如何限制meteor应用程序发送的电子邮件数量吗?我想防止我的应用程序受到垃圾邮件发送者的攻击

这是我的代码:

/server/email.js文件:

Meteor.methods({

 sendEmail: function (text) {
  check([text], [String]);
   this.unblock();
   Email.send({
    to: 'x@y.com',
    from: 'y@z.com',
    subject: 'New message from contact form',
    text: text,
   });
  }
});
/client/contact.js文件:

Template.contactForm.events({
  'submit form#contactForm':function(e){
    var contactForm = $(e.currentTarget),
     fname = contactForm.find('#firstName').val(),
     email = contactForm.find('#email').val(),
     message = contactForm.find("#message").val();

     var dataText = "Message from: " + 
                  fname + " " + 
                  "\rEmail: " + email + 
                  "\rContent:" + message;

      Meteor.call('sendEmail', dataText);
    }
 });

您的问题缺乏详细信息,但我假设您正在寻找用户不是机器人的验证,并且不会滥用您的
sendMail
方法


您可以使用goggle reCAPTCHA,一旦您有了设置键和设置

您可以提供更多详细信息并告诉我们您尝试了什么。