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

 

 

 

 

 

 

 

 

Access Attached Message (Embedded Email)

How to access an email embedded within another email (i.e. an attached message).

Download: Chilkat Cocoa Objective-C Libraries

NSMutableString *strOutput = [NSMutableString stringWithCapacity:1000];

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

//  Load an email from a .eml
BOOL success;
success = [email LoadEml: @"embeddedEmail.eml"];
if (success != YES) {
    [strOutput appendString: email.LastErrorText];
    [strOutput appendString: @"\n"];
    self.mainTextField.stringValue = strOutput;
    return;
}

//  Display how many attached emails are embedded within
//  this one:
int numAttached;
numAttached = [email.NumAttachedMessages intValue];
[strOutput appendString:[NSString stringWithFormat: @"numAttached = %d\n"
    ,numAttached]];

//  Get the 1st attached message.
CkoEmail *email2;
email2 = [email GetAttachedMessage: [NSNumber numberWithInt: 0]];
if (!(email2 == nil )) {

    //  Display the subject, From, and a header field...
    [strOutput appendString: email2.Subject];
    [strOutput appendString: @"\n"];
    [strOutput appendString: email2.From];
    [strOutput appendString: @"\n"];
    [strOutput appendString: [email2 GetHeaderField: @"X-SOMETHING"]];
    [strOutput appendString: @"\n"];
}


self.mainTextField.stringValue = strOutput;



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