運行,我有以下流星方法設置:流星電子郵件沒有定義,而是從Meteor.methods
// Defined in collections/collections.js
Meteor.methods({
email: function(options) {
this.unblock();
Email.send(options);
}
});
我稱之爲是這樣的:
// Defined in client/main.js
Meteor.call('email', {
to: '[email protected]', from: '[email protected]',
text: 'testing testing'
});
我得到兩個錯誤,一個在瀏覽器控制檯:
Exception while simulating the effect of invoking 'email'
ReferenceError {stack: "ReferenceError: Email is not defined↵ at Meteor…js?acc2397bd1f7321a583a30e0d4628ec4f9fded4b:369:3", message: "Email is not defined"}
ReferenceError: Email is not defined
(etc....)
在我的服務器殼其他
運行meteor
:
Exception while invoking method 'email' ReferenceError: Email is not defined
(etc....)
發生了什麼事?我覺得我已經完全按照documentation's instructions,而且我沒有做過類似錯誤的任何事情,例如this one或this one等問題。
當您運行meteor服務器時,您是否爲您的smtp服務設置了MAIL_URL環境變量? – Paul
另外,試着把第一個塊'Meteor.methods'放在/ server **中** – Paul
@Paul,我沒有設置這個變量,我只是意識到我甚至沒有*一個smtp服務。哈我想我假設流星傢伙照顧所有的包裹。讓人驚訝。 – blaineh