I am developing a functionality that will read all emails from a mailbox and will process the attachment files.
When any mail is sent from Outlook, its attachment is saved as winmail.dat. [Please note that I already have code to download attachments using IMAP PHP. My email attachments are stored in one folder in my codebase on the server.] I need to extract the winmail.dat attachment into its original format. The solutions I came across till now all need manual efforts like an online tool which gives extracted files, or software that enables us to convert .DAT files.
But I need to extract using a script or any automated process like cron or something. [I am using Linux - centos 5.7 server.]
Is there any library or any other way for my application to "unpack" theses files so I can get the attachments WITHOUT doing it MANUALLY one by one?
Thanks!
Download rpm package from http://pkgs.org/centos-5-rhel-5/flexbox-x86_64/tnef-1.4.7-1.x86_64.rpm.html
use Package: tnef-1.4.7-1.x86_64.rpm
Installation:
Copy into a folder and Install rpm tnef package -
To Extract attachment [winmail.dat] :
Go in directory where you want to extract your attachment files.
run command: