Sample code for 30+ languages & platforms
Swift

Transition from MailMan.LoadEml to Email.LoadEml

Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let mailman = CkoMailMan()!

    // ...
    // ...

    var filePath: String? = "c:/dir/example.eml"

    // ------------------------------------------------------------------------
    // The MailMan.LoadEml method is deprecated:

    var emailObj: CkoEmail? = mailman.loadEml(emlPath: filePath)
    if mailman.lastMethodSuccess == false {
        print("\(mailman.lastErrorText!)")
        return
    }

    // ...
    // ...

    emailObj = nil

    // ------------------------------------------------------------------------
    // Do the equivalent using Email.LoadEml.

    let email = CkoEmail()!
    success = email.loadEml(mimePath: filePath)
    if success == false {
        print("\(email.lastErrorText!)")
        return
    }


}