First of all, there is really no specific question you asked. Where, in fact, are you getting the email? Is it on your computer or is it on a server? It seems to me that it is on the server, since, in your example output, the program asks for your email login information.
So, to begin programming any sort of thing, one must define what, in fact, we are going to program. It's quite obvious that we will be writing a
scraper, or a program that grabs and processes data for use later. It's not very common to write scrapers in C/C++, and for future scrapers I would use a dynamic language like Perl or Python, but for the sake of argument, we will create a C++ scraper anyway. There are three parts to every scraper:
> Grabbing the data
> Processing the data
> Outputting the processed data
For this particular scraper, the most advanced part will be grabbing the data. For this case you will need a POP email library or an IMAP email library. (Of course, you could write the sockets and all the other stuff by hand, but do you really want to? Exactly.)
Of course, you could look yourself up this post on
http://stackoverflow.com/questions/58210/c-smtp-example.
Along with a
stringstream
and a whole lot of
>>
, I'm sure you can figure it out.
Good luck!