summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2017-03-11 01:29:13 -0800
committerCarson Fleming <cflems@cflems.net>2017-03-11 01:29:13 -0800
commit3d0d3a86106ece4ea298ab2f262b3af5ff8a7728 (patch)
treeb75b297d980f5b061595cea8b29fe42503907684 /inc/functions.php
parenta44a0e047a7582fe7e31743e1b03a17cf2987f73 (diff)
downloadbulletin-3d0d3a86106ece4ea298ab2f262b3af5ff8a7728.tar.gz
Almost there...
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php18
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;
+ }
}
?>