Chilkat HOME Android™ ASP Visual Basic VB.NET C# iOS (IPhone) Objective-C C++ C Unicode C++ Unicode C MFC Delphi DLL Delphi ActiveX FoxPro Java Perl PHP Extension PHP ActiveX Python PowerShell Ruby SQL Server VBScript
multipart/related Email Sub-PartsDownload: Chilkat .NET Assemblies C# example demonstrating how to access the related items potentially contained within HTML email. // Related items are the embedded graphics, style sheets, etc. that are // often included in HTML email. These are not considered to be "attachments". // HTML emails that include related items (i.e. embedded images or sytle sheets) // are formatted as a multipart/related MIME message. Chilkat makes // it easy to access the related items, filenames, data, etc. or to save // the related items to disk files. // This example demonstrates most of the functionality... private void SaveRelatedItems(Chilkat.Email email) { string filename; byte [] relatedData; string relatedString; // Get the number of related items contained within the email. int n = email.NumRelatedItems; int i; for (i=0; i<n; i++) { filename = email.GetRelatedFilename(i); MessageBox.Show("Related item " + Convert.ToString(i) + " filename = " + filename); // Save the related item to the "relatedItemsDir" sub-directory email.SaveRelatedItem(i, "relatedItemsDir"); // You can access the contents of the related item by calling // GetRelatedData. If (for example) the related item was a GIF file, // the relatedData byte array would contain the binary GIF image data. relatedData = email.GetRelatedData(i); // You can also access the contents of a related item as a string. // (This would make sense for sytle sheets) // The charset passed in the 2nd argument indicates the character encoding // of the characters within the text. Because C# strings are Unicode, // the component is (implicitly) converting from that charset to Unicode. relatedString = email.GetRelatedString(i, "utf-8"); } } Important: The download for this
example does not contain the ChilkatDotNet.dll which |
© 2000-2013 Chilkat Software, Inc. All Rights Reserved.