/kamailgun-swift

Mailgun-Swift provides simple alternative apis when you need to send an email with your iOS app using Mailgun.

Primary LanguageSwiftMIT LicenseMIT

Mailgun-In-Swift

CocoaPods GitHub License Swift 4

Mailgun-In-Swift provides simple alternative APIs when you need to send an email with your iOS app using Mailgun.

❓ Why?

For developing iOS App, we need to send a email in background without any action sometimes. Or there is the need to send a simple email instead of using MailComposeViewController or SMTP libray. In these cases, sending emails using Mailgun is a better option. This project help you simplify the original Mailgun APIs and provide you a simple alternative in Swift.

📧 Mailgun

Mailgun provides a simple reliable API for transactional emails. You will need to have an ApiKey and an account to use the client.

:octocat: Installation

Get Mailgun-In-Swift on CocoaPods, just add pod 'Mailgun-In-Swift' to your Podfile.

🎓 Usage

Usage is very simple

import Mailgun-In-Swift

let mailgun = MailgunAPI(apiKey: "YouAPIKey", clientDomain: "yourDomain.com")

mailgun.sendEmail(to: "to@test.com", from: "Test User <test@test.com>", subject: "This is a test", bodyHTML: "<b>test<b>") { mailgunResult in

  if mailgunResult.success{
    print("Email was sent")
  }

}

✌️ License

MIT

👽 Author

Ao Zhang - https://kevinao.com