Working with POP3 from Win32 application
Hi
Please help me choose how (an API, component, library etc) can I work with POP3 in the following task. I have no experience with POP3 and do not know where to start.
I have C++ Win32-application (MS Visual C++ 2005 or 2008) that must:
- periodically (say once in 5 min) check a mailbox via POP3
- retrieve new messages from there, process them (the processing is specific for the my task) and remove the processed messages.
The question is: what (an API, component, library etc) should be used for this task? Most probably there will be several solutions - if so, please recommend better one.
If, say, there is a ready component that resolves the task, but it is implemented on .Net - how easy to integrate it with C++ application?
Thanx
Re: Working with POP3 from Win32 application
POP is a simple text based protocol which can easily be implemented by just opening a socket to the POP server and send/recv commands to/from the socket. The protocol is described in RFC1939:
http://www.faqs.org/rfcs/rfc1939.html
There's really only a few required commands:
USER name
PASS string
QUIT
STAT
LIST [msg]
RETR msg
DELE msg
NOOP
RSET
QUIT
You can do it yourself with a telnet client by just telneting to port 110 and typing the commands.
Re: Working with POP3 from Win32 application
Thank you for the replies
During this time my task became more complicated (:-)) Now I should not only receive mails via POP3 but also convert body of received mail into plain text (WCHAR* string). I mean: to convert removing formatting elements like HTML tags (when a mail is in HTML format) etc., leaving only text. Now I am not interested in content of attachments - I need only mail's text.
The question is: do you know a component that can solve the task too? Or: one component to read POP3, another one for extracting text from received e-mail. The components may be commercial ones (my employer is rich enough to pay for them ;-)
Re: Working with POP3 from Win32 application
Sorry, I don't know of anything that will parse HTML. Perhaps the IE web browser component with its plethora of sparsely documented interfaces,or the MAPI could do this, but I've never tried.