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 Multipart/Mixed MIME messageThis example was provided for a customer who requested an example that demonstrates how to create a multipart/mixed message with various sub-parts. Private Sub Command1_Click()
Dim topLevel As New ChilkatMime
topLevel.UnlockComponent "UnlockCode"
topLevel.NewMultipartMixed
' Add an XML part
Dim mimePart As New ChilkatMime
mimePart.SetBodyFromXml "<test>This is a test</test>"
mimePart.SetHeaderField "Content-ID", "</tnn-200102/mm7-submit>"
topLevel.AppendPart mimePart
' Create a multipart/mixed sub-part and append it
Dim mixedSubPart As New ChilkatMime
mixedSubPart.NewMultipartMixed
' Now add items to mixedSubPart
Dim m As New ChilkatMime
m.SetBodyFromPlainText "This is the SMIL"
m.SetHeaderField "Content-ID", "<file.smil>"
m.SetHeaderField "Content-Type", "application/smil; charset=us=ascii"
mixedSubPart.AppendPart m
Dim m2 As New ChilkatMime
m2.SetBodyFromPlainText "This is plain text"
m2.Charset = "us-ascii"
m2.SetHeaderField "Content-ID", "<mytext.txt>"
m2.SetHeaderField "Content-Location", "mytext.txt"
mixedSubPart.AppendPart m2
Dim mGif As New ChilkatMime
mGif.SetBodyFromFile "dude.gif"
m.SetHeaderField "Content-ID", "<tiger.gif>"
m.SetHeaderField "Content-Location", "tiger.gif"
mixedSubPart.AppendPart mGif
topLevel.AppendPart mixedSubPart
' Display the MIME
Text1.Text = topLevel.GetMime()
End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.