Link to home
Start Free TrialLog in
Avatar of Torus
Torus

asked on

write a pop3 program

I am writing a pop3 program and would like to know what the
good way to parse the mail or multipart mail body. In general practice, is it likely to finish popping a mail and then write the content to a temp file before parse the mailbody or analyse the data immediately once get the data?
which one is easier for coding?

Also, is there any reference about that especially parsing multipart body?

Actually, for some reasons, I should write the program. So, it seems no use if OCXs are suggested. However, it is most appreciated if there are source codes for reference. :)
Thanks

Actually,  
Avatar of anzen
anzen

Since You're working on a NET I think it's better to write all received data down to a temp file, then, when the message has been completely received split header from body (searching for the first "blank" line) and next parsing the two pieces, for more details about POP3 protocol see the RFC documents, You can easily find them on some sites (e.g. ftp://ftp.garr.it) the RFC which You'd read first are the 821, 822 and 1725

Bye.

Avatar of Torus

ASKER

Thanks for your answer.
 I understand the RFCs give me the idea of smtp and pop3. However, maybe my question is not clear,  I am concerning how to code the parsing mechanism. It seems quite complicated expecially the content-type is rfc822/message since it may contain another
header within the body.


Avatar of Torus

ASKER

Thanks for your answer.
 I understand the RFCs give me the idea of smtp and pop3. However, maybe my question is not clear,  I am concerning how to code the parsing mechanism. It seems quite complicated expecially the content-type is rfc822/message since it may contain another
header within the body.


ASKER CERTIFIED SOLUTION
Avatar of anzen
anzen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Torus

ASKER

I have finished the parsing mechanism. Anyway, thanks for your answer.

Avatar of Torus

ASKER

BTW, What's the control for?
It's a control pack featuring POP3, SMTP, NNTP, HTTP, FTP and other OCX, it was formerly distributed by MS, now it's freely downloadable from the URL I mentioned above