我正在用 phantomjs 进行一些屏幕抓取。我正在尝试实现一个错误处理系统,该系统在刮板失败时使用 mandrill api https://mandrillapp.com/api/docs/messages.html发送电子邮件。
mandrill api 采用如下所示的 post 方法。您将如何使用 phantomjs 通过 mandrill 发送邮件?
var data = {
"key": "VdFwNvj-dLwaI6caAh8ODg",
"message": {
"html": "This aggression will not stand",
"text": "This aggression will not stand",
"subject": "example subject",
"from_email": "the-dude@gmail.com",
"from_name": "The Dude",
"to": [{
"email": "lebowski@gmail.com",
"name": "lebowski"
}]
},
"async": false
};
$.ajax({
type: "POST",
url: 'https://mandrillapp.com/api/1.0/messages/send.json',
data: data
});