]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mail.php
Use ToSelector choice again.
[quix0rs-gnu-social.git] / lib / mail.php
index a5e9efded1aba97c299f896ca1da959613b30954..da22eb6715a1b2c333ae0cf60f6271f513e373f5 100644 (file)
@@ -30,9 +30,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 require_once 'Mail.php';
 
@@ -54,7 +52,7 @@ function mail_backend()
         $backend = $mail->factory(common_config('mail', 'backend'),
                                  common_config('mail', 'params') ?: array());
         if ($_PEAR->isError($backend)) {
-            throw new ServerException($backend->getMessage());
+            throw new EmailException($backend->getMessage(), $backend->getCode());
         }
     }
     return $backend;
@@ -84,7 +82,7 @@ function mail_send($recipients, $headers, $body)
         assert($backend); // throws an error if it's bad
         $sent = $backend->send($recipients, $headers, $body);
         if ($_PEAR->isError($sent)) {
-            throw new ServerException($sent->getMessage());
+            throw new EmailException($sent->getMessage(), $sent->getCode());
         }
         return true;
     } catch (PEAR_Exception $e) {