Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

VB to Convert Web Page into HTML Email and Send

Download Visual Basic Project Files and Source Code

This Visual Basic example program downloads a Web Page, converts it into an HTML email, and sends it.

' Visual Basic program to convert a Web page into an HTML email and send.
Private Sub Command1_Click()

    Dim mht As New ChilkatMHT
    
    mht.UnlockComponent "MhtUnlockCode"
    Dim email As New ChilkatEmail2
    
    Set email = mht.GetEmail("http://www.google.com/")
    
    ' Save it as an EML file
    ' The email is part of the Chilkat Mail component, so we must unlock it.
    Dim mailman As New ChilkatMailMan2
    mailman.UnlockComponent "MailUnlockCode"
    
    ' The email subject is automatically initialized to the title of the
    ' Web page, so we'll change it here.
    email.Subject = "Google Home Page"
    
    ' We can save the email to EML for use by Outlook Express.
    email.SaveEml "google.eml"
    
    ' Set our SMTP host, and add a recipient to the email.
    mailman.SmtpHost = "mail.earthlink.net"
    success = email.AddTo("Chilkat Support", "support@chilkatsoft.com")
    
    ' Sent the HTML email.
    email.FromName = "Chilkat MHT"
    email.FromAddress = "mht@chilkatsoft.com"
    success = mailman.SendEmail(email)
    
    mailman.SaveLastError "mailLog.xml"
    mht.SaveLastError "mhtLog.xml"
    
    
End Sub

 

Need a specific example? Send a request to support@chilkatsoft.com

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