Cocoa Objective-C Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Objective-C Examples

Bounced Email
Digital Certificates
Digital Signatures
DKIM / DomainKey
DSA
Email Object
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
POP3
RSA
MIME
SMTP
Socket
SOCKS Proxy
Spider
SSH Key
SSH
SFTP
Tar
Upload
XML
XMP
Zip


More Examples...
Amazon S3
NTLM
RSS
Atom
PPMD
Deflate
Bzip2
LZW
Diffie-Hellman
Bz2
Character Encoding
CSV

 

 

 

 

 

 

 

 

Iterate Email Headers

Demonstrates how to iterate over the email header fields.

Download: Chilkat Cocoa Objective-C Libraries

NSMutableString *strOutput = [NSMutableString stringWithCapacity:1000];

CkoEmail *email = [[[CkoEmail alloc] init] autorelease];

//  First, load an email from a file.
//  Note: an email object may be loaded from a file, or
//  downloaded directly from a POP3 or IMAP server...
BOOL success;
success = [email LoadEml: @"testReceivedHdrs.eml"];
if (success != YES) {
    [strOutput appendString: email.LastErrorText];
    [strOutput appendString: @"\n"];
    self.mainTextField.stringValue = strOutput;
    return;
}

//  How many header fields?
int n;
n = [email.NumHeaderFields intValue];
if (n > 0) {

    //  Display the name and value of each header:
    int i;
    NSString *name;
    NSString *value;
    for (i = 0; i <= n - 1; i++) {
        name = [email GetHeaderFieldName: [NSNumber numberWithInt: i]];
        value = [email GetHeaderFieldValue: [NSNumber numberWithInt: i]];
        [strOutput appendString:[NSString stringWithFormat: @"%d\n",i]];
        [strOutput appendString: name];
        [strOutput appendString: @"\n"];
        [strOutput appendString: value];
        [strOutput appendString: @"\n"];

    }

}


self.mainTextField.stringValue = strOutput;



© 2000-2013 Chilkat Software, Inc. All Rights Reserved.