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從表單元素中讀取。