You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
First of all, I want to thank you for your replies. I have already created a utility to send and recieve emails but what I want to know is how to parse incoming emails to segragate the sections of the email; that is, the headers (Return Path, From, To, Cc, etc..), body, attachments.
The headers seems straightforward. The body if it is a plain text (Content-Type: text/plain) I think the body starts after the first empty line (TCP LINE nTCP, Buffer: if Buffer=""). But, if the Content-Type is a multipart that is not the case, right? Parts are separated by boundaries (e.g. ------=_NextPart_000_0000_01C9812C.039AA3A0--) and it may contain more that one delimiter in case there are attachments.
If there are attachments the header should contain a line like "Content-Type: multipart/mixed; boundary=" the defined boundary remains the same throughout the email but is preceded with -- the lines following a boundary line up to the first blank line will describe the content type and encoding if any. I seem to remember the MS website has a list of the standard ones they use.
Simple way to find most is to write a simple pop3 client that just dumps the entire text to a file and then send it an email with a bunch of different types of attachments from outlook or hotmail or yahoo mail etc and have a look at what you get.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment