Parse supports both Mailgun and Mandrill out of the box.
See their documentation
You will need to write a CloudCode function, then call it from your app.
PFCloud.callFunctionInBackground("hello", withParameters:[:]) {
(result: AnyObject!, error: NSError!) -> Void in
if error == nil {
// result is "Hello world!"
}
}
Example code snippets to send mail using Mailgun.
var Mailgun = require('mailgun');
Mailgun.initialize('myDomainName', 'myAPIKey');
Mailgun.sendEmail({
to: "email@example.com",
from: "Mailgun@CloudCode.com",
subject: "Hello from Cloud Code!",
text: "Using Parse and Mailgun is great!"
}, {
success: function(httpResponse) {
console.log(httpResponse);
response.success("Email sent!");
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});