summaryrefslogtreecommitdiffstats
path: root/usr/local/bin/mail.php
blob: 130d9e0480487e6f2e11fa2ebe30e9baad725a51 (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