开发者

read email Using Pop3 client on asp.net web page

开发者 https://www.devze.com 2022-12-26 21:04 出处:网络
I want to read Email开发者_如何转开发s through pop3. On my asp.net web page how to do let me know,

I want to read Email开发者_如何转开发s through pop3. On my asp.net web page how to do let me know,

which control should I use for showing email?


Here are a couple of libraries allowing you to retrieve messages from a POP3 server:

  • C#Mail
  • OpenPop
  • Pop3.Net
  • CodeProject article


Dim pop3Client As Pop3Client
Dim i As Integer =1
pop3Client = New Pop3Client
pop3Client.Connect("pop.gmail.com", 995, True)
pop3Client.Authenticate("myname@gmail.com", "mypassword")
Dim inbox_count As Integer = pop3Client.GetMessageCount
Do While (inbox_count >= i)
Dim message As Message = pop3Client.GetMessage(i)
Dim messagePart As MessagePart = message.MessagePart.MessageParts(0)
messagePart.BodyEncoding.GetString(messagePart.Body)'give you message body
message.Headers.From.Address'give you from address
message.Headers.DateSent'date of mail send
message.Headers.Subject'subject of the mail
i= i + 1
Loop
0

精彩评论

暂无评论...
验证码 换一张
取 消