我已经使用Pop3客户端连接 gmail 。他们是否可以在不打开邮件的情况下从特定邮件ID中删除邮件?有用的回应将不胜感激。
答案 0 :(得分:0)
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)
If message.Headers.From.Address.ToString = "XXXXXX@XXXX.com" then
pop3Client.DeleteMessage(i)
End if
i=i+1
Loop