MFC Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

MFC Examples

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


 

 

 

 

 

 

 

 

Access Attached Message (Embedded Email)

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

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

// Needs #include <CkEmail.h>

    CkString strOut;

    CkEmail email;

    //  Load an email from a .eml
    bool success;
    success = email.LoadEml("embeddedEmail.eml");
    if (success != true) {
        strOut.append(email.lastErrorText());
        strOut.append("\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    //  Display how many attached emails are embedded within
    //  this one:
    long numAttached;
    numAttached = email.get_NumAttachedMessages();
    strOut.appendInt(numAttached);
    strOut.append("\r\n");

    //  Get the 1st attached message.
    CkEmail *email2 = 0;
    email2 = email.GetAttachedMessage(0);
    if (!(email2 == 0 )) {

        //  Display the subject, From, and a header field...
        strOut.append(email2->subject());
        strOut.append("\r\n");
        strOut.append(email2->ck_from());
        strOut.append("\r\n");
        strOut.append(email2->getHeaderField("X-SOMETHING"));
        strOut.append("\r\n");
    }


    SetDlgItemText(IDC_EDIT1,strOut.getUnicode());

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

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