Permalink
Browse files

Added error message in the event of `mail` failure

Display a simple error if the email did not send, just so developers aren't entirely in the dark in case comments stop working.
  • Loading branch information...
1 parent 6c9de08 commit 9a8906d5d4df2eb773f949574bc86b84ab750753 @IQAndreas IQAndreas committed May 20, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 commentsubmit.php
View
@@ -59,6 +59,11 @@
$msg .= "$key: $value\n";
}
-mail($EMAIL_ADDRESS, $SUBJECT, $msg, "From: $EMAIL_ADDRESS");
-
-include $COMMENT_RECEIVED;
+if (mail($EMAIL_ADDRESS, $SUBJECT, $msg, "From: $EMAIL_ADDRESS"))
+{
+ include $COMMENT_RECEIVED;
+}
+else
+{
+ echo "There was a problem sending the comment. Please contact the site's owner.";
+}

0 comments on commit 9a8906d

Please sign in to comment.