X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_email.php;h=5844e6d4569633ff92cf89d0dcc4ac2a6c8af041;hp=170c2a10a42614455b87ed480e3b7f3f7ee24f95;hb=2f2865d1fe482da9da08928aa72bb8dc183a1b80;hpb=f895ca862918c568dfd59d31dd2bff243c76a092 diff --git a/DataObjects/Core_email.php b/DataObjects/Core_email.php index 170c2a10..5844e6d4 100644 --- a/DataObjects/Core_email.php +++ b/DataObjects/Core_email.php @@ -535,8 +535,21 @@ Content-Transfer-Encoding: 7bit mkdir(dirname($cachePath), 0700, true); } - file_put_contents($cachePath, $this->bodytext); + if (empty($this->use_file)) { + file_put_contents($cachePath, $this->bodytext); + return; + } + // use-file + $mailtext = file_get_contents($this->use_file); + + require_once 'Mail/mimeDecode.php'; + require_once 'Mail/RFC822.php'; + + $decoder = new Mail_mimeDecode($mailtext); + $parts = $decoder->getSendArray(); + file_put_contents($parts[2], $this->bodytext); + } function cachedImages()