(Swift) Transition from MailMan.LoadEml to Email.LoadEml
Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() {
let mailman = CkoMailMan()!
// ...
// ...
var filePath: String? = "c:/dir/example.eml"
// ------------------------------------------------------------------------
// The MailMan.LoadEml method is deprecated:
var emailObj: CkoEmail? = mailman.loadEml(filePath)
if mailman.lastMethodSuccess == false {
print("\(mailman.lastErrorText!)")
return
}
// ...
// ...
emailObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using Email.LoadEml.
let email = CkoEmail()!
var success: Bool = email.loadEml(filePath)
if success == false {
print("\(email.lastErrorText!)")
return
}
}
|