VB.NET Examples

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

VB.NET Examples

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

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

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

Using a .MHT File as a Log

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Demonstrates how .mht and .eml files are identical. Both file types contain nothing more than MIME. It is only the file extension that is mapped to different default applications that makes them different.

        ' A Chilkat customer asked this question:
        ' This is exactly what we're looking to do.

        ' 1. Want to create a .MHT file with some header and other information and save it.
        ' 2. Open the same file and add an image(s) to this document save and close it
        ' 3. Open the same file and add some text to it and save and close it.
        ' 4. Open the same file and add another image(s)/text save and close it
        ' 5. Continue this process as long as we want or runs out of memory

        ' This example code is one possible solution:

        ' the mailman is only instantiated for unlocking...
        Dim mailman As New Chilkat.MailMan()
        mailman.UnlockComponent("anything")

        ' .mht files and .eml files are nothing more than MIME,
        ' the only difference is in the default programs associated with
        ' the file extension.  For .mht it is a browser (IE), for .eml it is an
        ' email client (Outlook).
        Dim email As New Chilkat.Email()

        ' Initialize the "MHT" with text and an image.
        Dim cid As String
        cid = email.AddRelatedFile("dudeRuby.gif")
        ' (You can download the GIF image here: http://chilkatsoft.com/images/dudeRuby.gif )

        Dim initialText As String
        initialText = "This is the initial text"

        email.SetHtmlBody("<html><body><p>" + initialText + "<p>" + _
            "<img src=""CID:" + cid + """></body></html>")

        email.SaveEml("x1.mht")

        ' Now add another image...
        Dim email2 As New Chilkat.Email()
        email2.LoadEml("x1.mht")

        cid = email2.AddRelatedFile("dudePython.gif")
        ' (You can download the GIF image here: http://chilkatsoft.com/images/dudePython.gif )

        ' Get the existing HTML body and add another image to it.
        Dim html As String
        html = email2.GetHtmlBody()

        Dim newFragment As String
        newFragment = "<p><img src=""CID:" + cid + """></body></html>"
        html = html.Replace("</body></html>", newFragment)
        email2.SetHtmlBody(html)

        email2.SaveEml("x2.mht")

        ' Now add a line of text...
        Dim email3 As New Chilkat.Email()
        email3.LoadEml("x2.mht")

        html = email3.GetHtmlBody()
        html = html.Replace("</body></html>", "<p>This is the new text added...</body></html>")
        email3.SetHtmlBody(html)

        email3.SaveEml("x3.mht")




 

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

Mail Component · XML Parser