我正在用phantomjs做一些屏幕抓取。我試圖實現一個錯誤處理系統,當刮板失敗時發送一個包含mandrill api https://mandrillapp.com/api/docs/messages.html的電子郵件。你會如何發送郵件通過mandrill phantomjs?
mandrill api採用後面的方法。 你將如何通過幻影通過mandrill發送郵件?
var data = {
"key": "VdFwNvj-dLwaI6caAh8ODg",
"message": {
"html": "This aggression will not stand",
"text": "This aggression will not stand",
"subject": "example subject",
"from_email": "[email protected]",
"from_name": "The Dude",
"to": [{
"email": "[email protected]",
"name": "lebowski"
}]
},
"async": false
};
$.ajax({
type: "POST",
url: 'https://mandrillapp.com/api/1.0/messages/send.json',
data: data
});