Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Read POP3 Mail in VB.NET 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 |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.