Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

 

Embed PDF, MS-WORD, XML, and GIF in Multipart/Mixed MIME

Create MIME containing a PDF, MS-WORD document, XML document, and GIF image.

The MIME produced by this example (scroll down to see code) looks like this:

Content-Type: multipart/mixed;
	boundary="-----_chilkat_497_6119_39274c1d.69931ed1_.MIX"

This is a multi-part message in MIME format.

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX
content-disposition: attachment;
	 filename="dude.gif"
content-transfer-encoding: base64
Content-Type: image/gif;
	name="dude.gif"

R0lGODlhZABkAPf/AP////f39+fn7+/v9/f3/+fn99bW597e79bW78bG3s7O57291rW1zsbG
57293rW11q2tzqWlxq2t1qWlzpycxpSUvYyMtYSErZyczpSUxoyMvYSEtXt7rYSEvXt7tXNz
...
wxAGcf2vMwE08FYXMvmrAuSR4E84VAhILTAsJDIijyQim9P1jVQpglWrG0ADLOABJYG5GjBs
ClERHqH/GBUQADs=

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX
content-disposition: attachment;
	 filename="dude.gif"
content-transfer-encoding: base64
Content-Type: image/gif;
	name="dude.gif"

R0lGODlhZABkAPf/AP////f39+fn7+/v9/f3/+fn99bW597e79bW78bG3s7O57291rW1zsbG
57293rW11q2tzqWlxq2t1qWlzpycxpSUvYyMtYSErZyczpSUxoyMvYSEtXt7rYSEvXt7tXNz
...
wxAGcf2vMwE08FYXMvmrAuSR4E84VAhILTAsJDIijyQim9P1jVQpglWrG0ADLOABJYG5GjBs
ClERHqH/GBUQADs=

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX
content-disposition: attachment;
	 filename="halfMarathonWaiver.pdf"
content-transfer-encoding: base64
Content-Type: application/pdf;
	name="halfMarathonWaiver.pdf"

JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURl
Y29kZT4+CnN0cmVhbQp4nO1bbW/cuBH+vr9CRfthdcgqJEVRYoAidV7uLkWS3qUGgiJXFM7G
...
Ci9JRCBbKHsfO+TdPLVEgU+Ir7qbh10pKHsfO+TdPLVEgU+Ir7qbh10pXQo+PgpzdGFydHhy
ZWYKMzMzMjEKJSVFT0YK

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX
content-disposition: attachment;
	 filename="sample.doc"
content-transfer-encoding: base64
Content-Type: application/msword;
	name="sample.doc"

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAzwAAAAAA
AAAAEAAA0QAAAAEAAAD+////AAAAAM0AAADOAAAA////////////////////////////////
...
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAA==

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX
content-disposition: attachment;
	 filename="pigs.xml"
content-transfer-encoding: 7bit
Content-Type: text/xml;
	name="pigs.xml"

<pig-rescue>
	<image-base>images</image-base>
    <animal>
    	<species>pot belly pig</species>
    	<type>Cathy's Herd</type>
        <name>Molly II</name>
        <birth>February, 1998</birth>
...
</pig-rescue>          
                            

-------_chilkat_497_6119_39274c1d.69931ed1_.MIX--


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

#include <CkMime.h>

void ChilkatSample(void)
    {
    CkMime mime;

    bool success;
    success = mime.UnlockComponent("Anything for 30-day trial");
    if (success == false) {
        printf("Failed to unlock component\n");
        return;
    }

    //  Initialize this MIME object as a multipart/mixed:
    success = mime.NewMultipartMixed();

    //  Now insert some files:
    success = mime.AppendPartFromFile("dude.gif");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Insert a GIF Image into the MIME:
    success = mime.AppendPartFromFile("dude.gif");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Add a PDF to the MIME:
    success = mime.AppendPartFromFile("halfMarathonWaiver.pdf");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Add a MS-Word file to the MIME
    success = mime.AppendPartFromFile("sample.doc");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Add an XML document to the MIME:
    success = mime.AppendPartFromFile("pigs.xml");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Save the MIME to a file.
    success = mime.SaveMime("outMime.txt");
    if (success == false) {
        printf("%s\n",mime.lastErrorText());
        return;
    }

    //  Success!
    printf("Success!\n");

    }

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

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

Mail Component · .NET Mail Component · XML Parser