summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-10-03 00:38:32 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-10-03 00:38:32 -0400
commitf9fb2569aa1efafc099d53606d0ebdec2d9535d8 (patch)
tree2aacd3c6dede9ef3d18ef9a1cf1d213f4cbae0df
parent11b774144d4ca0d0436df0484b069eca4c608e62 (diff)
downloadpfsense-f9fb2569aa1efafc099d53606d0ebdec2d9535d8.zip
pfsense-f9fb2569aa1efafc099d53606d0ebdec2d9535d8.tar.gz
Alert if there is a problem sending the test message
-rw-r--r--etc/inc/notices.inc7
-rw-r--r--usr/local/www/system_advanced_notifications.php3
2 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc
index d24909b..cb72961 100644
--- a/etc/inc/notices.inc
+++ b/etc/inc/notices.inc
@@ -303,10 +303,13 @@ function notify_via_smtp($message) {
fwrite($fd, $message);
fclose($fd);
- if($smtp->SendMessage($from, array($to), $headers, $message))
+ if($smtp->SendMessage($from, array($to), $headers, $message)) {
log_error("Message sent to {$to} OK");
- else
+ return;
+ } else {
log_error("Could not send the message to {$to} -- Error: {$smtp->error}");
+ return("Could not send the message to {$to} -- Error: {$smtp->error}");
+ }
}
diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php
index 50e3aef..c327001 100644
--- a/usr/local/www/system_advanced_notifications.php
+++ b/usr/local/www/system_advanced_notifications.php
@@ -87,7 +87,7 @@ if ($_POST) {
notify_via_growl("This is a test message form pfSense. It is safe to ignore this message.");
// Send test message via smtp
- notify_via_smtp("This is a test message form pfSense. It is safe to ignore this message.");
+ $savemsg = notify_via_smtp("This is a test message form pfSense. It is safe to ignore this message.");
pfSenseHeader("system_advanced_notifications.php");
exit;
@@ -103,6 +103,7 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
+<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="system_advanced_notifications.php" method="post">
<?php
if ($input_errors)
OpenPOWER on IntegriCloud