Skip to content

Commit

Permalink
do not send empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWillner committed Jan 10, 2013
1 parent 9ad5116 commit 66dd6d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$subject="OpenPGP.js Example";
$to="[email protected]";
$headers = "From: OpenPGP.js Example <[email protected]>\r\n";
$redirect = "http://openpgpjs.org";
$redirect = "http://openpgpjs.org/";
/* -------------------------------------------------------------------------- */

/* input -------------------------------------------------------------------- */
Expand All @@ -20,7 +20,8 @@
if (filter_var($user, FILTER_VALIDATE_EMAIL)) {
$headers = "From: $user\r\n";
}
mail($to, $subject, $message, $headers);
if (!empty($message))
mail($to, $subject, $message, $headers);
/* -------------------------------------------------------------------------- */

/* Redirect browser */
Expand Down

0 comments on commit 66dd6d9

Please sign in to comment.