summaryrefslogtreecommitdiffstats
path: root/src/usr/local/bin/mail.php
blob: 001ee670638413a86c1c4a6c6c384a79227e1230 (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
#!/usr/local/bin/php-cgi -q
<?php
require_once("config.inc");
require_once("globals.inc");
require_once("notices.inc");
$options = getopt("s::");

$message = "";

if ($options['s'] <> "") {
	$subject = $options['s'];
}


$in = file("php://stdin");
foreach ($in as $line) {
	$message .= "$line";
}

if (!empty($subject)) {
	send_smtp_message($message, $subject);
} else {
	send_smtp_message($message);
}
?>
OpenPOWER on IntegriCloud