【发布时间】: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);
}
});
【问题讨论】:
-
您能否提供更多详细信息并告诉我们您的尝试。