aboutsummaryrefslogtreecommitdiff
path: root/vendor/email_message/debug_message.php
blob: ea8bd6b4d5b6f80d16aa87d213790e89fa956d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/*
 * debug_message.php
 *
 *
 *
 */


class debug_message_class extends email_message_class
{

	private $logfile ="";

	function __construct() {
		$this->logfile = $GLOBALS['TMP_PATH'] . '/studip-mail-debug.log';
	}

	function SendMail($to,$subject,$body,$headers,$return_path) {
		if ($log = fopen($this->logfile, "a")){
			if(strlen($headers)) $headers.="\n";
			fwrite($log, "\n-- " . strftime("%x %X"). ' ' . $GLOBALS['user']->username);
			fwrite($log, "\nTo: ".$to."\nSubject: ".$subject."\n".$headers."\n");
			fwrite($log,$body."\n");
			fclose($log);
		}
	}
}
?>