diff options
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/inc/functions.php b/inc/functions.php index ca43d85..12bf2fc 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -72,12 +72,16 @@ function bulletin_hash ($str, $salt = '') { function bulletin_mail ($to, $subject, $body) { global $b_config; - $mg = new Mailgun\Mailgun($b_config['mg_key']); - return $mg->sendMessage($b_config['mg_dom'], array( - 'from' => $b_config['mail_from'], - 'to' => $to, - 'subject' => $subject, - 'html' => $body, - )); + try { + $mg = new Mailgun\Mailgun($b_config['mg_key']); + return $mg->sendMessage($b_config['mg_dom'], array( + 'from' => $b_config['mail_from'], + 'to' => $to, + 'subject' => $subject, + 'html' => $body, + )); + } catch (Exception $e) { + return 0; + } } ?> |
