测试已测试 | ✓ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年9月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Chris Jimenez 维护。
依赖项 | |
ObjectMapper | >= 0 |
Alamofire | >= 0 |
SwiftMailgun 在您需要使用 iOS 应用程序通过 MailGun 发送电子邮件时提供了简单的替代方案。
有时,您需要在 iOS 应用程序中设置简单的电子邮件表单,或者在执行某个操作后触发电子邮件,而无需为该服务设置您自己的服务,有时您不想使用 MailComposeViewController
或使用 SMTP
库。当您需要使用 iOS 应用程序发送电子邮件时,这提供了一种简单的替代方案。
Mailgun 提供了一种简单的可靠的 API,用于发送事务性电子邮件。您将需要一个 ApiKey
和账户才能使用此客户端。
在 CocoaPods 上获取 SwiftMailgun
,只需在 Podfile 中添加 pod 'SwiftMailgun'
使用方法非常简单
import SwiftMailgun
let mailgun = MailgunAPI(apiKey: "YouAPIKey", clientDomain: "yourDomain.com")
mailgun.sendEmail(to: "[email protected]", from: "Test User <[email protected]>", subject: "This is a test", bodyHTML: "<b>test<b>") { mailgunResult in
if mailgunResult.success{
print("Email was sent")
}
}
MIT
Chris Jimenez - http://chrisjimenez.net,@chrisjimeneznat