【发布时间】:2016-05-17 16:10:44
【问题描述】:
我正在尝试学习如何使用 API,我偶然发现了 codecademy 的 course,我正在学习他们的 Mandrill API 课程
// Create a function to log the response from the Mandrill API
function log(obj) {
$('#response').text(JSON.stringify(obj));
}
// create a new instance of the Mandrill class with your API key
var m = new mandrill.Mandrill('sDJw??-3FK4r1h8aH2vckw');
// create a variable for the API call parameters
var params = {
"message": {
"from_email":"jack??@yahoo.com",
"to":[{"email":"jack??@yahoo.com"}],
"subject": "Sending a text email from the Mandrill API",
"text": "I'm learning the Mandrill API at Codecademy."
}
};
function sendTheMail() {
// Send the email!
m.messages.send(params, function(res) {
log(res);
}, function(err) {
log(err);
});
}
API 密钥应该可以工作。该课程允许我在之前的练习中进行测试。听说山魈最近有变动,提到
您必须添加 SPF 和 DKIM 记录并验证您的所有权 在您可以通过您的帐户发送电子邮件之前发送域。
我想知道我是否在练习中犯了错误,或者由于最近的变化,该练习是否不再有效。我希望我给你看的链接没有被屏蔽。
这是错误响应:
[{"email":"jack??@yahoo.com","status":"rejected","_id":"?7ec118ce30044d493795081552c57d2","reject_reason":"unsigned"}]
【问题讨论】:
标签: javascript api mandrill