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

 

 

 

 

 

 

Download Email and Forward

Download: Chilkat .NET Assemblies

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




 

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

Mail Component · XML Parser