MFC Examples

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

MFC Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
Diffie-Hellman
DKIM / DomainKey
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


 

 

 

 

 

 

 

 

Create EDIFACT MIME

Create an EDIFACT MIME 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
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
// Needs #include <CkMime.h>

    CkString strOut;


    CkMime mime;

    bool success;
    success = mime.UnlockComponent("Anything for 30-day trial.");
    if (success == false) {
        strOut.append("Failed to unlock\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    //  Assuming  you have an EDIFACT document loaded into
    //  a string variable, set the MIME body with it:
    const char * ediBody;
    ediBody = "UNB+IATB:1+6XPPC+LHPPC+940101:0950+1' ...";
    mime.SetBodyFromPlainText(ediBody);

    //  The call to SetBodyFromPlainText automatically set the
    //  content-type to "text/plain".
    //  However, we want:  application/EDIFACT; name=om080923.edi
    mime.put_ContentType("application/EDIFACT");
    mime.put_Name("om080923.edi");

    //  We want the content-disposition to be:
    //  Content-Disposition: attachment; filename="om080923.edi"
    mime.put_Disposition("attachment");
    mime.put_Filename("om080923.edi");

    //  Make sure the content-transfer-encoding is 7bit:
    //  Content-Transfer-Encoding: 7bit
    mime.put_Encoding("7bit");

    //  Note: MIME header fields are case insensitive.

    //  Add a few other header fields:
    mime.AddHeaderField("Message-ID","<CHILKAT-MID-83cf2fbf-10cb-4322-ad79-4c1097fd56f2@Matt>");
    mime.AddHeaderField("From","support@chilkatsoft.com");
    mime.AddHeaderField("To","admin@chilkatsoft.com");
    mime.AddHeaderField("Subject","This is a test");
    mime.AddHeaderField("MIME-VERSION","1.0");
    mime.AddHeaderField("Date","Tue, 23 Sep 2008 07:26:39");

    //  Display the complete MIME:
    strOut.append(mime.GetMime());
    strOut.append("\r\n");



    SetDlgItemText(IDC_EDIT1,strOut.getUnicode());

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

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