Click here to Skip to main content
16,019,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends

i have coding to read mail in our app but it show error that POP3 is not define plz help me

XML
Private Sub cmdSubmit_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.ServerClick
       'normally validate username and password. Validation left out for code simplification
       Dim pop As New POP3(txtServer.Value, txtUsername.Value, txtPassword.Value)

       Try
           'connect to the server
           pop.Connect()
       Catch ex As Exception
           'record an exceptions and exit
           Message1.Text = "<font color=red>The following exception occurred: <br>" + ex.Message + "</font>"
           Return
       End Try

       Dim count As Integer = pop.MessageCount()
       Dim msg As String = String.Empty
       If count > 1 Then
           'get the first message
           msg = "<strong>Message 1</strong><br><br>"
           msg += "<pre>" + Server.HtmlEncode(pop.GetMessageAsText(1)) + "</pre>"
       Else
           'if the first message doesn't exist, write out a friendly message
           msg = "No messages at the server"
       End If

       'disconnect
       pop.Disconnect()

       'show the message
       Message1.Text = msg

   End Sub
Posted
Comments
ZurdoDev 23-Mar-12 11:50am    
Have you tried using the System.Net.Mail namespace and the SmtpClient and MailMessage objects?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900