我在Mac上将Mailgun-js@0.22.0与Node.js v8.15.1结合使用
我收到一个禁止的错误:,这是我的代码-
const emailConfig = {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
domain: 'mail.cloud-invoices.co.uk',
host: 'api.eu.mailgun.net'
};
var mailgun = require('mailgun-js')(emailConfig);
const data = {
from: 'Excited User info@mail.cloud-invoices.co.uk',
to: 'info@bigswebdesign.co.uk',
subject: 'Hello',
text: 'Testing some Mailgun awesomness!'
};
mailgun.messages().send(data, (error, body) => {
if(error) throw error;
console.log(body);
});
有什么想法吗?
谢谢, 斯图尔特