Browse Source

let base mailer store files as .eml instead of .txt

allows opening email for view in mail program directly
tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
5b489aaa49
  1. 2
      framework/yii/mail/BaseMailer.php

2
framework/yii/mail/BaseMailer.php

@ -281,7 +281,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
$file = $path . '/' . call_user_func($this->fileTransportCallback, $this, $message); $file = $path . '/' . call_user_func($this->fileTransportCallback, $this, $message);
} else { } else {
$time = microtime(true); $time = microtime(true);
$file = $path . '/' . date('Ymd-His-', $time) . sprintf('%04d', (int)(($time - (int)$time) * 10000)) . '-' . sprintf('%04d', mt_rand(0, 10000)) . '.txt'; $file = $path . '/' . date('Ymd-His-', $time) . sprintf('%04d', (int)(($time - (int)$time) * 10000)) . '-' . sprintf('%04d', mt_rand(0, 10000)) . '.eml';
} }
file_put_contents($file, $message->toString()); file_put_contents($file, $message->toString());
return true; return true;

Loading…
Cancel
Save