0
为什么从电子邮件包Email.send()函数包含“从”的说法,如果每封邮件将被从你的process.env.MAIL_URL环境变量定义的电子邮件发送?流星email.send()从外地目的
服务器端代码:
process.env.MAIL_URL = 'smtp://my_email%40gmail.com:[email protected]:465/'
Meteor.methods({
sendEmail: function (to, from, subject, text) {
check([to, from, subject, text], [String]);
// Let other method calls from the same client start running,
// without waiting for the email sending to complete.
this.unblock();
Email.send({
to: to,
from: from,
subject: subject,
text: text
});
}
});
客户端代码:
Meteor.call('sendEmail',
[email protected],
email,
name,
message);
,其中电子邮件,姓名和消息是variabl es从表单元素中读取。