Sample code for 30+ languages & platforms
Swift

Example: MailMan.FetchAll method

Demonstrates how to call the FetchAll method.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    success = false
    let mailman = CkoMailMan()!

    // Setup mailman with POP3 server and login settings...
    // ...
    // ...

    let bundle = CkoEmailBundle()!
    var keepOnServer: Bool = true
    var headersOnly: Bool = false
    // numBodyLines only applies if downloading headers-only.
    var numBodyLines: Int = 0

    success = mailman.fetchAll(keepOnServer: keepOnServer, headersOnly: headersOnly, numBodyLines: numBodyLines, bundle: bundle)
    if success == false {
        print("\(mailman.lastErrorText!)")
        return
    }

    // ...
    // ...

}