hello all , I am writing a module that has to extract the text part of a mail, This mail may contain attachments but then I would ignore the attachments If it contained html I would require to strip html tags and covert to text I am presently doing this with MIME::Parser and html2text.pl but I think the module MIME::Parser itself is an overkill. I parses all parts of the mail while I am interested only in the first part.
how can you be sure you are only interested in the first part? There is nothing that states that the "text" portion of a body must be the first attachment in a multipart message, unless you are referring to what is usually known as the "preamble" which is not considered a MIME part, even in a multipart message, and does not have to exist at all, and to the best of my knowledge will never be HTML (though I suppose someone could add html codes to it). Are you certain that only one of your attachments will be HTML? If the "text" of the message is HTML and an attachment is HTML as well, how can you distinguish between the two (see above for why order may not work)? While MIME::Parser or any of the other various message parsing modules may have some overhead, in most cases they will probably keep you out of trouble and are likely faster than anything you can write yourself. If you definitely want to proceed with your own attempt at this then crack open one of the various message parsers and see how they handle things...
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
