(Objective-C) 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.
#import <CkoMailMan.h>
#import <NSString.h>
#import <CkoEmail.h>
CkoMailMan *mailman = [[CkoMailMan alloc] init];
// ...
// ...
NSString *filePath = @"c:/dir/example.eml";
// ------------------------------------------------------------------------
// The MailMan.LoadEml method is deprecated:
CkoEmail *emailObj = [mailman LoadEml: filePath];
if (mailman.LastMethodSuccess == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using Email.LoadEml.
CkoEmail *email = [[CkoEmail alloc] init];
BOOL success = [email LoadEml: filePath];
if (success == NO) {
NSLog(@"%@",email.LastErrorText);
return;
}
|