private function smtpSend() { $smtp = new Smtp(); try { $smtp->open($this->hostname, $this->port, $this->timeout); $smtp->hello($this->hello); $smtp->auth($this->user, $this->pwd); $smtp->from($this->from); $smtp->to($this->to); $smtp->data($this->subject, $this->message); $smtp->quit(); $smtp->close(); } catch (Exception $e) { throw new Exception($e); } }
if (Mailer::is_online_host() == true) { $new_config['engine_send'] = ENGINE_UNIQ; } if (empty($new_config['smtp_pass'])) { $new_config['smtp_pass'] = $old_config['smtp_pass']; } if ($new_config['use_smtp'] && function_exists('fsockopen')) { preg_match('/^http(s)?:\\/\\/(.*?)\\/?$/i', $new_config['urlsite'], $match); require WAMAILER_DIR . '/class.smtp.php'; $smtp = new Smtp(); $result = $smtp->connect($new_config['smtp_host'], $new_config['smtp_port'], $new_config['smtp_user'], $new_config['smtp_pass'], $match[2]); if (!$result) { $error = true; $msg_error[] = sprintf(nl2br($lang['Message']['bad_smtp_param']), htmlspecialchars($smtp->msg_error)); } else { $smtp->quit(); } } else { $new_config['use_smtp'] = 0; } if (!$new_config['disable_stats'] && extension_loaded('gd')) { require WA_ROOTDIR . '/includes/functions.stats.php'; if (!is_writable(WA_STATSDIR)) { $error = true; $msg_error[] = sprintf($lang['Message']['Dir_not_writable'], htmlspecialchars(wa_realpath(WA_STATSDIR))); } } else { $new_config['disable_stats'] = 1; } if (!$error) { if (!$db->build(SQL_UPDATE, CONFIG_TABLE, $new_config)) {