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
Multipart/Related HTML Related Items
This article discusses related items found in 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 Sub SaveRelatedItems(email As ChilkatEmail2) Dim filename As String Dim relatedData As Variant Dim relatedString As String n = email.NumRelatedItems For i = 0 To n - 1 filename = email.GetRelatedFilename(i) MsgBox "Related item " & Str(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 Variant 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 VB6 strings are Unicode, ' the component is (implicitly) converting from that charset to Unicode. relatedString = email.GetRelatedString(i, "utf-8") Next End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.