Maily
轻松发送第三方邮件客户端的邮件。
支持的客户端
客户端 | URL Scheme |
---|---|
Gmail | googlegmail |
Dispatch | x-dispatch |
Spark | readdle-spark |
Airmail | airmail |
Microsoft Outlook | ms-outlook |
Yahoo Mail | ymail |
安装
从源文件夹手动导入文件到您的项目中
使用
在开始之前,您需要将所有需要的安全方案添加到 Info.plist 文件中的 LSApplicationQueriesSchemes
。如果不进行此步骤,您将无法找到第三方客户端。
要添加到 Info.plist 的代码
<key>LSApplicationQueriesSchemes</key>
<array>
<string>ymail</string>
<string>ms-outlook</string>
<string>airmail</string>
<string>readdle-spark</string>
<string>x-dispatch</string>
<string>googlegmail</string>
</array>
向可用的客户发送电子邮件的对话框展示
Maily.shared.sendMail(recipient: "", subject: "", body: "", presentHandler: {}, cancelHandler: {})
在执行此操作之前,您可能想要检查客户的可用性。为此,您可以调用
Maily.shared.canSendMail
要访问可用的客户,只需使用
Maily.shared.clients
本地化
要将操作表“取消”按钮本地化,只需更改 Maily.shared
中的 cancelButtonTitle
属性。
自定义
几乎每个类、属性和方法都是 open
的,因此您可以简单地对其子类化或构建外观。
要添加新的第三方客户端,您可以将其添加到 Maily.shared.clients
中,或者为库做贡献。
需求
- iOS 10+
- Xcode 10.2+(Swift 5 编译)
作者
伊凡·斯梅塔宁,[email protected]
许可协议
Maily 在 MIT 许可协议下提供。有关更多信息,请参阅 LICENSE 文件。