Hi
Can anyone suggest ways to decode an e-mail message that is multi-part and extract just the plain text part of it.
I can get the message as a raw stream from my SMTP server which will then pipe to a CGI version of PHP which reads each line of the message and parses it.
I can decode the header very sucessfully and keep a log of it, my problem is that if someone sends an HTML message or BASE64 encoded message, I can't get at the plain text version of it.
I may also want to store the separate parts (eg if someone e-mailed a graphic file) elsewhere but keep a log of what's going on.
I can probably handle breaking up the different parts but how do I unencode the Base64 back to something useful - which may include a filename?
Any help gladly received.
James