0

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?

Ukuser32
  • 2,147
  • 2
  • 22
  • 32
  • This should help to understand .. http://stackoverflow.com/questions/13442250/is-there-an-e-mail-template-file-like-oft-which-can-be-opened-in-all-e-mail-p – Bobot May 10 '16 at 12:09
  • Thanks but that doesn't help with this specific situation. – Ukuser32 May 10 '16 at 12:41

0 Answers0