VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

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

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Byte Array
VB.NET FTPS
System.IO

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

Download Email and Forward

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

Download email from a POP3 server into a collection of MIME strings (each email is a MIME string) and forward to another recipient. The MIME is never parsed by Chilkat.

        ' Read email from a POP3 server and return the complete MIME source of each email.
        ' The emails downloaded from the POP3 server are not loaded into Chilkat.Email objects,
        ' therefore they are not parsed, unwrapped (for encrypted/signed email), or modified
        ' in any way.
        Dim mailman As New Chilkat.MailMan
        mailman.UnlockComponent("anything for 30-day trial")

        mailman.MailHost = "mail.chilkatsoft.com"
        mailman.PopUsername = "****"
        mailman.PopPassword = "****"

        ' We'll need the SMTP hostname and (optionally) the login
        ' to send email...
        mailman.SmtpHost = "smtp.chilkatsoft.com"
        mailman.SmtpUsername = "****"
        mailman.SmtpPassword = "****"

        ' Get the UIDLs of all the mail messages on the POP3 server.
        Dim allUidls As Chilkat.StringArray
        allUidls = mailman.GetUidls()

        ' mimeArr is an object containing collection of strings
        Dim mimeArr As Chilkat.StringArray
        ' Download the entire mailbox.
        ' Call FetchMultipleMime to leave the email on the server.
        ' Call TransferMultipleMime to download and remove from the server.
        mimeArr = mailman.TransferMultipleMime(allUidls)
        'mimeArr = mailman.FetchMultipleMime(allUidls)

        ' Show how many emails were downloaded.
        MessageBox.Show(mimeArr.Count)

        ' Forward each email to another recipient.
        Dim i As Integer
        Dim success As Boolean
        For i = 0 To mimeArr.Count
            success = mailman.SendMime("matt@chilkatsoft.com", "somebody-else@chilkatsoft.com", mimeArr.GetString(i))
            If (Not success) Then
                MessageBox.Show(mailman.LastErrorText)
                ' ... do whatever else you want...
            End If
        Next




 

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

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

Mail Component · XML Parser