Reputation: 21
I was able to send a regular email with a body text using a cocoapod https://cocoapods.org/?q=mailgun But is there a way to send an image attachment?
Upvotes: 1
Views: 337
Reputation: 9395
According to it's SDK (which sadly hasn't been improved for Swift and has a dependency on AFNetworking which is objc):
let message = MGMessage(from:"Excited User <[email protected]>",
to:"Jay Baird <[email protected]>",
subject:"Mailgun is awesome!",
body:"Mailgun is great, here is a picture of a cat.")!
// someImage: UIImage
// type can be either .JPEGFileType or .PNGFileType
message.add(someImage, withName: "image01", type:.PNGFileType)
SwiftMailgun seems like a better fit for Swift but it's still in early stages (Check the TODO list).
Upvotes: 2