有人可以解释一下如何限制流星应用程序发送的电子邮件数量吗?我想阻止我的应用程序来自垃圾邮件发送者。
这是我的代码:
/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);
}
});