Sample code for 30+ languages & platforms
Swift

Transition from MailMan.LoadMbx to MailMan.LoadMbxFile

Provides instructions for replacing deprecated LoadMbx method calls with LoadMbxFile.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let mailman = CkoMailMan()!

    // ...
    // ...

    var filePath: String? = "c:/test/example.mbx"

    // ------------------------------------------------------------------------
    // The LoadMbx method is deprecated:

    var bundleObj: CkoEmailBundle? = mailman.loadMbx(mbxPath: filePath)
    if mailman.lastMethodSuccess == false {
        print("\(mailman.lastErrorText!)")
        return
    }

    // ...
    // ...

    bundleObj = nil

    // ------------------------------------------------------------------------
    // Do the equivalent using LoadMbxFile.
    // Your application creates a new, empty EmailBundle object which is passed 
    // in the last argument and filled upon success.

    let bundleOut = CkoEmailBundle()!
    success = mailman.loadMbxFile(mbxPath: filePath, bundle: bundleOut)
    if success == false {
        print("\(mailman.lastErrorText!)")
        return
    }


}