Visual Basic Examples

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

VB Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SFTP
SMTP
Socket
Spider
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
Bzip2
PPMD
Deflate
LZW


VB Strings
VB Byte Array

 

 

 

 

 

 

 

Create Multipart/Alternative MIME

Download Chilkat MIME ActiveX

Create a simple multipart/alternative MIME message.

Dim mime As New ChilkatMime

Dim success As Long
success = mime.UnlockComponent("Anything for 30-day trial")
If (success = 0) Then
    MsgBox "Failed to unlock"
    Exit Sub
End If

'  Make this a multipart/alternative MIME message:
mime.NewMultipartAlternative 

'  Create a plain-text part and add it to the multipart/alternative MIME.
Dim ptMime As New ChilkatMime
ptMime.SetBodyFromPlainText "This is the plain-text body"
mime.AppendPart ptMime

'  Now do the same for HTML:
Dim htMime As New ChilkatMime
htMime.SetBodyFromHtml "<html><body>This is the HTML body</body></html>"
mime.AppendPart htMime

'  Show the full multipart/alternative MIME text which includes both parts:
Text1.Text = Text1.Text & mime.GetMime() & vbCrLf

'  Need to change the boundary string?
mime.Boundary = "__NewBoundaryString__123"

'  Need to change the charset?
Set ptMime = mime.GetPart(0)
ptMime.Charset = "utf-8"
Set htMime = mime.GetPart(1)
htMime.Charset = "utf-8"

'  Need to change the encoding?
htMime.Encoding = "base64"

'  Now show the MIME again:
Text1.Text = Text1.Text & "---- After Changes ----" & vbCrLf
Text1.Text = Text1.Text & mime.GetMime() & vbCrLf

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