VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
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...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Byte Array
VB.NET FTPS
System.IO

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

Read POP3 Mail in VB.NET

Download VB.NET Project Files and Source Code

This VB.NET sample program shows how to read mail from a POP3 server.

    ' Read mail in VB.NET
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim mailman As New Chilkat.MailMan()
        mailman.UnlockComponent("UnlockCode")

        mailman.MailHost = "mail.chilkatsoft.com"
        mailman.PopPassword = "password"
        mailman.PopUsername = "login"

        ' Use CopyMail to leave email on the POP3 server,
        ' Use TransferMail to copy and remove it from the server.
        Dim bundle As Chilkat.EmailBundle
        bundle = mailman.CopyMail()

        TextBox1.Text = ""

        Dim i As Long
        For i = 0 To bundle.MessageCount - 1
            Dim email As Chilkat.Email
            email = bundle.GetEmail(i)

            ' Save attachments to the "attachments" directory.
            'email.SaveAllAttachments("attachments")

            TextBox1.Text = TextBox1.Text & "Email " & Str(i) & vbCrLf
            TextBox1.Text = TextBox1.Text & email.Subject & vbCrLf
            TextBox1.Text = TextBox1.Text & email.From & vbCrLf

            Dim j As Long
            For j = 0 To email.NumTo - 1
                TextBox1.Text = TextBox1.Text & "TO: " & email.GetTo(j) & vbCrLf
            Next

            ' Save the email to XML
            email.SaveXml("Email" & Str(i) & ".xml")

            ' Save the email to EML
            email.SaveEml("Email" & Str(i) & ".eml")

        Next
    End Sub
End Class

' ABOUT THIS EXAMPLE:
' This example shows how to read email in VB.NET
' How to download POP3 mail in VB.NET
' How to access POP3 email in VB.NET
' VB.NET source code to read mail
' VB.NET sample code to read email.


Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 
 

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

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

Mail Component · XML Parser