Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Create EDIFACT MIMECreate 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 #include <C_CkMime.h> void ChilkatSample(void) { HCkMime mime; BOOL success; const char * ediBody; mime = CkMime_Create(); success = CkMime_UnlockComponent(mime,"Anything for 30-day trial."); if (success == FALSE) { printf("Failed to unlock\n"); return; } // Assuming you have an EDIFACT document loaded into // a string variable, set the MIME body with it: ediBody = "UNB+IATB:1+6XPPC+LHPPC+940101:0950+1' ..."; CkMime_SetBodyFromPlainText(mime,ediBody); // The call to SetBodyFromPlainText automatically set the // content-type to "text/plain". // However, we want: application/EDIFACT; name=om080923.edi CkMime_putContentType(mime,"application/EDIFACT"); CkMime_putName(mime,"om080923.edi"); // We want the content-disposition to be: // Content-Disposition: attachment; filename="om080923.edi" CkMime_putDisposition(mime,"attachment"); CkMime_putFilename(mime,"om080923.edi"); // Make sure the content-transfer-encoding is 7bit: // Content-Transfer-Encoding: 7bit CkMime_putEncoding(mime,"7bit"); // Note: MIME header fields are case insensitive. // Add a few other header fields: CkMime_AddHeaderField(mime,"Message-ID","<CHILKAT-MID-83cf2fbf-10cb-4322-ad79-4c1097fd56f2@Matt>"); CkMime_AddHeaderField(mime,"From","support@chilkatsoft.com"); CkMime_AddHeaderField(mime,"To","admin@chilkatsoft.com"); CkMime_AddHeaderField(mime,"Subject","This is a test"); CkMime_AddHeaderField(mime,"MIME-VERSION","1.0"); CkMime_AddHeaderField(mime,"Date","Tue, 23 Sep 2008 07:26:39"); // Display the complete MIME: printf("%s\n",CkMime_getMime(mime)); CkMime_Dispose(mime); } |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.