I am not sure what is your goal, but I think you should save the whole message data in the database in BLOB table fields and only parse the message when you need to display it to the users.
The problem is that e-mail messages can arrive in many formats, like plain text, HTML, text and HTML, text and HTML with images and CSS, and many other format variants that you cannot fully anticipate because there can be infinite combinations.
So, if you use the Decoded and then Analyze function, you can get a simplified view of each message, and do whatever you want just when you need to display to the user of process the message somehow.
Just be careful with the attachments if you intend to use the original file names. You also need to be careful when display messages with HTML parts, because these can have Javascript code that when display to the user may steal the browser cookies and send to a remote site, thus performing cross-site scripting attacks. This can be used to steal logged user session cookies and abuse the user privileges.
To avoid this problem always filter Javascript from HTML messages before displaying it to the user in a Web page. Here you can read more about this type of attacks and how to prevent them.
phpclasses.org/blog/post/55-Improve ...