From f7bf48e47f196e4319ff7274d39b5e407fa6cb6b Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Tue, 26 Apr 2016 19:02:41 +0000
Subject: [PATCH] email:  Regression for commit #dcfa5527

---
 include/class.mailer.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/class.mailer.php b/include/class.mailer.php
index b124ffd65..a97cf650f 100644
--- a/include/class.mailer.php
+++ b/include/class.mailer.php
@@ -560,7 +560,9 @@ class Mailer {
         }
 
         //No SMTP or it failed....use php's native mail function.
-        $args = array('-f '.$this->getEmail()->getEmail());
+        $args = array();
+        if ($this->getEmail())
+            $args = array('-f '.$this->getEmail()->getEmail());
         $mail = mail::factory('mail', $args);
         // Ensure the To: header is properly encoded.
         $to = $headers['To'];
-- 
GitLab