Hi, I need to get unread emails from my inbox - to handle bounce-backs messages.
I don't need to get entire message. What I need is only: Subject and body only from unread e-mails.
I probably have to use IMAP, so could recommend me an "open-source" and good solution? so I can sell this software without any problems?
But, when smtp server don't support IMAP, I have to use POP3?
That project will be good for that? Or maybe there is some other, better way ?
Thanks for help,
-----------------------------------------------------------------------------------------------
UPDATE:
I've got an idea.
I can read how many messages are in inbox. So, I also can get the last one.
I can check if there is a bounce-back message in timer (every 5 minutes for example). I could get messages one by one, and check the date. If the message was sent before 5 min ago, i would break.
In that solution, I will not get all messages from an inbox every time. Is that good solution ?
The pseudo-code of my idea:
TIMER( Tick every 5minutes )
{
(LOCK)
loop(on inbox from end to begin)
{
if (message date < DateTime.Now.AddMinutes(-5);)
{
if (the subject is "Undelivered Mail Returned to Sender")
{
}
}
else
break;
}
(UNLOCK)
}