src/MailLogger.php
public function log($type, Message $mail): void
	{
		$timestamp = date('Y-m-d H:i:s');
		$type .= '.' . time();
		$file = $this->getLogFile($type, $timestamp);

		if (file_exists($file) && filesize($file)) {
			$file = str_replace(
				static::LOG_EXTENSION,
				'.' . uniqid() . static::LOG_EXTENSION,
				$file
			);
		}

		file_put_contents($file, $mail->generateMessage());
	}
public function log($type, Message $mail): void
	{
		$timestamp = date('Y-m-d H:i:s');
		$type .= '.' . time();
		$file = $this->getLogFile($type, $timestamp);

		if (file_exists($file) && filesize($file)) {
			$file = str_replace(
				static::LOG_EXTENSION,
				'.' . uniqid() . static::LOG_EXTENSION,
				$file
			);
		}

		file_put_contents($file, $mail->generateMessage());
	}
public function log ( $ type , Message $ mail ) : void { $ timestamp = date ( 'Y-m-d H:i:s' ) ; $ type .= '.' . time ( ) ; $ file = $ this -> getLogFile ( $ type , $ timestamp ) ; if ( file_exists ( $ file ) && filesize ( $ file ) ) { $ file = str_replace ( static :: LOG_EXTENSION , '.' . uniqid ( ) . static :: LOG_EXTENSION , $ file ) ; } file_put_contents ( $ file , $ mail -> generateMessage ( ) ) ; }
Log mail messages to eml file
Log mail messages to eml file