Kyprus Posted June 24, 2009 Share Posted June 24, 2009 Basically a user will upload a .msg file and I need to get any files attached to the email. I have been searching for a way to do this through PHP but have been unsuccessful. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
ldougherty Posted June 24, 2009 Share Posted June 24, 2009 I found something similar on Experts Exchange.. http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20274682.html "Well, at home I use Outlook Express and Express will store emails in the .EML format which is just plain text. The Outlook .MSG file format however is a binary format which is probably a structured storage format. You might be able to read it if you know about COM+ and structured storage. What you need to look into is the IStorage object combined with the StgOpenStorage API function and other storage related omethods and objects. Using this you might discover that the .MSG format holds a lot of valuable information once you've succesfully read the contents. Actually, that's the difference between the .EML format and the .MSG format. The EML stores the email in it's raw format while the MSG stores it as an object. Which is quite nice but it makes the MSG format unreadable unless you use IStorage to read it's contents. If you want to read a .MSG file, you'll have to learn a lot about COM. It's not too difficult but it's a lot of information and it overwhelmes inexperienced developers." There is actually a lot of helpful information in that thread. Quote Link to comment Share on other sites More sharing options...
Kyprus Posted June 25, 2009 Author Share Posted June 25, 2009 Thanks for the reply. So maybe an easy way to do this would be to first convert the email to a .eml? I found a class that will parse a plaintext MIME message and grab the attachments. So I've been looking for a way to convert the email but once again can't find anything useful. I'm surprised this isn't a more common thing. Quote Link to comment Share on other sites More sharing options...
Kyprus Posted June 25, 2009 Author Share Posted June 25, 2009 Anyone have an idea? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.