2010-04-16 65 views

回答

11

這裏有幾個庫,它允許用戶檢索一個POP3服務器的消息:

+0

@達林季米特洛夫,你能給我具體的代碼或網址嗎? 我需要像www.pageflakes.com(電子郵件小工具) – leton 2010-04-16 09:48:03

+0

OpenPop對我的工作非常好 – 2012-03-12 21:19:48

0
Dim pop3Client As Pop3Client 
Dim i As Integer =1 
pop3Client = New Pop3Client 
pop3Client.Connect("pop.gmail.com", 995, True) 
pop3Client.Authenticate("[email protected]", "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

爲了使這個答案有用,您必須告訴人們「Pop3Client」來自哪裏,因爲它不是標準的ASP .NET類。 – 2016-04-20 17:12:43

相關問題