I have created an OFT file (Outlook template file) using the COM plugin through PHP. What I need to do is replace the URLs with dynamic URLs on the fly when a user downloads the files. I have opened the file in a text editor and using the code below and both register errors (using the code below Outlook simply wouldn't open "Unable to open outlook")):
<?php
$file = file_get_contents('email1.oft');
file_put_contents('email1.oft',str_replace('There is a new','hello world',$file));
echo 'Completed';
?>
So my question is (how) can one read an OFT file and do a str replace on it? And if so how?