TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2017 |
SwiftSwift Version | 4.0.0 |
SPMSupports SPM | ✗ |
Maintained by Jérémie Girault, Kevin Lefevre.
Postal is a swift framework providing simple access to common email providers.
let postal = Postal(configuration: .icloud(login: "[email protected]", password: "mypassword"))
postal.connect { result in
switch result {
case .success:
print("success")
case .failure(let error):
print("error: \(error)")
}
}
let filter = .subject(value: "Foobar") && .from(value: "[email protected]")
postal.search("INBOX", filter: filter) { result in
switch result {
case .success(let indexes):
print("success: \(indexes)")
case .failure(let error):
print("error: \(error)")
}
}
let indexset = NSIndexSet(index: 42)
postal.fetchMessages("INBOX", uids: indexset, flags: [ .headers ], onMessage: { email in
print("new email received: \(email)")
}, onComplete: error in
if error = error {
print("an error occured: \(error)")
}
}
postal.logger = { log in
print(log)
}
Postal does not address the same goal as MailCore. You can take a look at our thoughts in the TechnicalNotes document.
Email protocol is standardized. However providers implementations often provides extension or variations of these standards. We tried to build a document to synthesize working around these variations here: ProviderQuirks.
Postal has been a great effort and we could really use your help on many areas:
If any of that sounds cool to you, please send a pull request!
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms that you can find here: CodeOfConduct.
Add the Postal repository as a submodule of your application’s repository.
git submodule add https://github.com/snipsco/Postal.git
git submodule update --init --recursive
Drag and drop Postal.xcodeproj
and Carthage/Checkouts/Result/Result.xcodeproj
into your application’s Xcode project or workspace.
On the “General” tab of your application target’s settings, add Postal.framework
and Result.framework
to the “Embedded Binaries” section.
If your application target does not contain Swift code at all, you should also set the EMBEDDED_CONTENT_CONTAINS_SWIFT
build setting to “Yes”.
Postal is released under the MIT License.