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