【问题标题】:Limit the number of emails sent by meteor app?限制流星应用发送的电子邮件数量?
【发布时间】:2016-03-23 23:20:33
【问题描述】:

谁能解释我如何限制从流星应用程序发送的电子邮件数量?我想阻止我的应用发送垃圾邮件。

这是我的代码:

/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);
    }
 });

【问题讨论】:

  • 您能否提供更多详细信息并告诉我们您的尝试。

标签: email meteor


【解决方案1】:

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

一旦您拥有设置密钥和设置here,您就可以将 goggle reCAPTCHA 与this package 一起使用

【讨论】:

    猜你喜欢
    • 2011-01-01
    • 2016-05-10
    • 2016-11-04
    • 2019-03-04
    • 2014-12-19
    • 1970-01-01
    • 1970-01-01
    • 2018-10-17
    • 1970-01-01
    相关资源
    最近更新 更多