Programming Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
DKIM / DomainKey
Diffie-Hellman
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3

 

 

 

 

 

 

 

 

Access Attached Message (Embedded Email)

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

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
#include <C_CkEmail.h>

void ChilkatSample(void)
    {
    HCkEmail email;
    BOOL success;
    long numAttached;
    HCkEmail email2;

    email = CkEmail_Create();

    //  Load an email from a .eml

    success = CkEmail_LoadEml(email,"embeddedEmail.eml");
    if (success != TRUE) {
        printf("%s\n",CkEmail_lastErrorText(email));
        return;
    }

    //  Display how many attached emails are embedded within
    //  this one:

    numAttached = CkEmail_getNumAttachedMessages(email);
    printf("%d\n",numAttached);

    //  Get the 1st attached message.

    email2 = CkEmail_GetAttachedMessage(email,0);
    if (!(email2 == 0 )) {

        //  Display the subject, From, and a header field...
        printf("%s\n",CkEmail_subject(email2));
        printf("%s\n",CkEmail_ck_from(email2));
        printf("%s\n",CkEmail_getHeaderField(email2,"X-SOMETHING"));
    }


    CkEmail_Dispose(email);

    }

Need a specific example? Send a request to support@chilkatsoft.com

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