From 700143eef8c29f106721b9f7556946eaf94aa380 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 29 Sep 2011 15:26:13 +0000 Subject: [PATCH] if we have NO password, eg. because we run by async service outside a regular user session --> fall back to the default profile / mail config from setup --- phpgwapi/inc/class.send.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 8ff6161de0..85d0a17a79 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -74,13 +74,17 @@ class send extends egw_mailer } $this->Username = $username; $this->Password = $ogServer->password; + // if we have NO password, eg. because we run by async service outside a regular user session + // --> fall back to the default profile / mail config from setup + if (empty($this->Password)) $bopreferences = false; } if ($this->debug) error_log(__METHOD__." using Host ".print_r($this->Host,true)." to be send"); if ($this->debug) error_log(__METHOD__." using User ".print_r($this->Username,true)." to be send"); if ($this->debug) error_log(__METHOD__." using Sender ".print_r($this->Sender,true)." to be send"); } } - } else { + } + if (!$bopreferences) { if ($this->debug) error_log(__METHOD__." using global config to send"); $this->Host = $GLOBALS['egw_info']['server']['smtp_server']?$GLOBALS['egw_info']['server']['smtp_server']:'localhost'; $this->Port = $GLOBALS['egw_info']['server']['smtp_port']?$GLOBALS['egw_info']['server']['smtp_port']:25;