protected function copyMail($header, $body) { $dir = rtrim($this->filePath, '/') . '/copy-' . date('Ymd') . '/'; if (isset(\Jelix\Core\App::coord()->request)) { $ip = \Jelix\Core\App::coord()->request->getIP(); } else { $ip = "no-ip"; } $filename = $dir . 'mail-' . $ip . '-' . date('Ymd-His') . '-' . uniqid(mt_rand(), true); \jFile::write($filename, $header . $body); }