Sample code for 30+ languages & platforms
Unicode C

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Unicode C Downloads

Unicode C
#include <C_CkEmailW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkMimeW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkEmailW email;
    HCkStringBuilderW sbMime;
    HCkMimeW mime;

    success = FALSE;

    email = CkEmailW_Create();
    success = CkEmailW_LoadEml(email,L"qa_data/eml/sample.eml");

    // Write the full MIME of the email to a StringBuilder.
    sbMime = CkStringBuilderW_Create();
    CkEmailW_GetMimeSb(email,sbMime);

    // Load the MIME object from the StringBuilder
    mime = CkMimeW_Create();
    success = CkMimeW_LoadMimeSb(mime,sbMime);

    wprintf(L"%s\n",CkMimeW_getMime(mime));


    CkEmailW_Dispose(email);
    CkStringBuilderW_Dispose(sbMime);
    CkMimeW_Dispose(mime);

    }