From abd6800a894506d7f19b28f4aea4a62836d213a0 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 21 Apr 2015 14:23:59 +0000 Subject: [PATCH] dont try to send if there is no smtpAccount --- phpgwapi/inc/class.egw_mailer.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.egw_mailer.inc.php b/phpgwapi/inc/class.egw_mailer.inc.php index f3d36b1f60..aa790052f5 100644 --- a/phpgwapi/inc/class.egw_mailer.inc.php +++ b/phpgwapi/inc/class.egw_mailer.inc.php @@ -444,6 +444,11 @@ class egw_mailer extends Horde_Mime_Mail try { $smtpAcc = emailadmin_account::get_default(true,false,false); + if (!$smtpAcc) + { + error_log(__METHOD__.__LINE__.'#'." Error: no SMTP Account available for ".__METHOD__); + return false; + } //error_log(__METHOD__.__LINE__.'#'.array2string($smtpAcc)); $mail = new egw_mailer($smtpAcc); $method = array(); @@ -493,7 +498,7 @@ class egw_mailer extends Horde_Mime_Mail } } - $mail->setFrom($from, $FromName); + $mail->setFrom($from, $FromName); $mail->addHeader('Subject', trim($subject)); // trim the subject to avoid strange wrong encoding problem if ($sender) $mail->addHeader('Return-Path', '<'.$sender.'>', true); if ($msgtype) $mail->addHeader('X-eGW-Type',$msgtype);