This is a simple sample code for having your inbox in an Asp.Net page:
No need to say, you have to change the third line with your own gmail credentials:
Dim client = New OpenPop.Pop3.Pop3Client client.Connect("pop.gmail.com", 995, True) client.Authenticate("mygmailaccountid@gmail.com", "mypassword") Dim messageCount = client.GetMessageCount() Dim allMessages = New List(Of Net.Mail.MailMessage)(messageCount) For i = 1 To Math.Max(10, messageCount) Dim message = client.GetMessage(i) Dim mailMessage = message.ToMailMessage() allMessages.Add(mailMessage) Next grdInbox.DataSource = allMessages grdInbox.DataBind() client.Dispose()
No comments:
Post a Comment