How to extract TNEF winmail.dat using a PHP script?

蓝咒 提交于 2019-12-06 11:22:25

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 -

rpm -ivh /path-of-downloaded-package/tnef-1.4.7-1.x86_64.rpm

To Extract attachment [winmail.dat] :

Go in directory where you want to extract your attachment files.

cd /path-to-extract-attachment/

run command:

tnef /path-of-attachment/winmail.dat

Equivalent PHP script:

chdir('/path-to-extract-attachment/');

$cmd = "tnef /path-of-attachment/winmail.dat";
shell_exec($cmd);

I feel your pain; dealing with proprietary systems which disregards existing widely established standards is pain in the *. The wikipedia page on TNEF has a list of libraries which aim at providing a decoder. Good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!