I want to read only unread emails using pop3.I have done this with imap
but now i also want this with pop3. I dont want that each time download
email and save it to local database and compare it for next time. I want
directly unread email from server using pop3.
or is there any way in pop3 for new email notification like outlook uses using pop3. ?
Hi,
<span style=“font-size:
10.0pt;font-family:“Courier New”;color:blue;mso-no-proof:yes”>static void<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”>
Pop3UnreadMessages()<o:p></o:p>
{
Pop3Client client = newPop3Client("pop.gmail.com", 995, "username", "password");
client.EnableSsl = true;
Pop3MessageInfoCollection msgs = client.ListMessages();
Console.WriteLine(msgs.Count);
foreach (Pop3MessageInfo msgInfo in msgs)
{
if (IsProcessed(msgInfo.UniqueId)) //means the message was already processed
{
continue;
}
//message is new and needs user attention
//Handle the unaddressed messages as per your requiremetnts
MailMessage msg = client.FetchMessage(msgInfo.UniqueId);
}
}
static bool IsProcessed(string UniquedId)
{
//check the email in processed list and return true or false accordingly
return true;
}