| | |
| | | if (isset($smtp_host_url['host']) && isset($smtp_host_url['scheme'])) |
| | | $smtp_host = sprintf('%s://%s', $smtp_host_url['scheme'], $smtp_host_url['host']); |
| | | |
| | | // remove TLS prefix and set flag for use in Net_SMTP::auth() |
| | | if (preg_match('#^tls://#i', $smtp_host)) { |
| | | $smtp_host = preg_replace('#^tls://#i', '', $smtp_host); |
| | | $use_tls = true; |
| | | } |
| | | |
| | | if (!empty($CONFIG['smtp_helo_host'])) |
| | | $helo_host = $CONFIG['smtp_helo_host']; |
| | | else if (!empty($_SERVER['SERVER_NAME'])) |
| | |
| | | // attempt to authenticate to the SMTP server |
| | | if ($smtp_user && $smtp_pass) |
| | | { |
| | | $result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type); |
| | | $result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type, $use_tls); |
| | | |
| | | if (PEAR::isError($result)) |
| | | { |
| | | $this->error = array('label' => 'smtpautherror', 'vars' => array('code' => $this->conn->_code)); |