Email 限制meteor应用程序发送的电子邮件数量?
有人能告诉我如何限制meteor应用程序发送的电子邮件数量吗?我想防止我的应用程序受到垃圾邮件发送者的攻击 这是我的代码: /server/email.js文件: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.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,一旦您有了设置键和设置您可以提供更多详细信息并告诉我们您尝试了什么。