Đang Thực Hiện

153362 Mail checker program - C++

We need 2 small components (C++ classes - written in VC++ 6.0), if can't do one of them, bid anyway, but indicate which one you gonna do.

First component to work with Yahoo Mail server, using Yahoo Mail protocol (they don't allow POP3, have their own protocol), second to work with Hotmail (they also don't allow POP3, utilize another protocol). It looks like Yahoo have some sort of HTTP-based protocol (they have Yahoo Mail Notifier - downloadable from their website), maybe it makes sense to utilize it. Hotmail used to have HTTP mail protocol, but they shut it down recently. So the only way to implement Hotmail is to use WinInet API calls to query pages, maintain context and load messages, emulating web browser. Yahoo is theoretically doable using their proprietary protocol, but if it's hard to hack it, then it can be done with WinInet too (but keeps in mind that Yahoo has two versions of their webmail - classic and new beta - which look way diffeent and therefore must be handled in completely different ways).

Each component: connects to mail server, logs on (using provided username/password), counts number of new e-mails and returns this count along with last unread item position (like 'cookie'). Upon first connection - it assumes no new e-mail, but then, counts from last position ID (this ID is maintained by the caller). For example, I could have the following in my mailbox initially:



When I call the component for the first time (e.g. call 'GetNewMail' method), it returns '0' (no new e-mails) and some sort of position idenitifier (e.g. time of last e-mail or something else, which uniquely identifes e-mail). Then imagine is a couple of new items arrive in this mailbox:





When I call component this time and pass item ID from previous call, I get '2' (2 new items). If a couple new items arrive again, I get '4' (2 previous + 2 new) etc. The component shall return LastID along with count. For example if I had 6 items and component treats 4 of them as new - the component would return ID of 6th item. 'time' field of event, maybe, or something more unique, if possible). And then we would pass this ID to component some of the call - and if we do - it returns count of items only since this ID.

For example if I had 6 items (the example above) and then 7th item arrive - I pass last ID - and get '1' (only one new items since those 6).

Time field as ID is not good because 2 or more e-mails can arrive at the same second, or daylight saving setting can be switching at the time of checking, so if possible, some sort of more unique ID should be returned. However, if none exists, you can use time.

Also, component shall have 'ReadMail' method which opens web browser and logs it on automatically so you don't have to enter webmail URL (e.g. [url removed, login to view] or [url removed, login to view])

and put username/password there.

I will provide sample code for component with similar functionality but implemented for POP3. Basically it does all said above - logs on, counts new e-mails, return last position etc. So you just need to replace POP3 code with hotmail/yahoo code.

(I'll provide these to winning bidder).

Component interface, just to illustrate it better:

// Init

bool Init (LPCTSTR user, LPCTSTR password, std::string* err_msg)

// Run browser

bool CheckMail(IN std::string cookie, OUT int* num_new_emails, OUT std::string* err_msg)

// Check mail - open web browser and do autologin

bool ReadMail (OUT std::string* err_msg)

// Mark as Read - returns new cookie.

bool MarkAsRead(OUT std::string* new_cookie) = 0

Kỹ năng: Bất kì công việc gì, Lập trình C

Xem thêm: sense checking, mind programming, programming hard, get programming done, event run, event programming, event based programming, else programming, string programming, read example, programming string, programming else, programming get, programming example, get string, beta programming, program hack website, std, mail checker, bool, api interface using, mail notifier, pop3 mail server, hack item, program sample

Về Bên Thuê:
( 25 nhận xét ) Saint Petersburg, Russian Federation

Mã Dự Án: #1899545