diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-07-14 03:35:34 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-07-14 03:35:34 +0400 |
commit | f026ee29ed32c0b885322765e6a8f3e31d6a1806 (patch) | |
tree | adfe3cfc2b36650ee47da6657d1628ab981207c8 /core/Mail.php | |
parent | 69fac3d9f3f7d08d1d194d064891cd6dc2286416 (diff) |
Fixes #2562 Kuddos kantan for the patch!
git-svn-id: http://dev.piwik.org/svn/trunk@5019 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Mail.php')
-rw-r--r-- | core/Mail.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/core/Mail.php b/core/Mail.php index cf648daf13..8146db3218 100644 --- a/core/Mail.php +++ b/core/Mail.php @@ -46,19 +46,14 @@ class Piwik_Mail extends Zend_Mail return; } $smtpConfig = array(); - if ( !empty($config->type) - || !empty($config->username) - || !empty($config->password) - || !empty($config->encryption) - ) - { - $smtpConfig = array( - 'auth' => strtolower($config->type), - 'username' => $config->username, - 'password' => $config->password, - 'ssl' => $config->encryption, - ); - } + if (!empty($config->type)) + $smtpConfig['auth'] = strtolower($config->type); + if (!empty($config->username)) + $smtpConfig['username'] = $config->username; + if (!empty($config->password)) + $smtpConfig['password'] = $config->password; + if (!empty($config->encryption)) + $smtpConfig['ssl'] = $config->encryption; $tr = new Zend_Mail_Transport_Smtp($config->host, $smtpConfig); Piwik_Mail::setDefaultTransport($tr); |