Skip to content

Commit

Permalink
Latest library.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubiclesoft committed Feb 2, 2019
1 parent b38d66a commit db97872
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions support/smtp.php
Expand Up @@ -969,7 +969,6 @@ private static function ProcessState__WriteData(&$state)
$state["data"] = (string)substr($state["data"], $result);

$state["result"]["rawsendsize"] += $result;
$state["result"]["rawsendheadersize"] += $result;

if (isset($state["options"]["sendratelimit"]))
{
Expand Down Expand Up @@ -1367,8 +1366,8 @@ public static function SendSMTPEmail($toaddr, $fromaddr, $message, $options = ar
if ($timeleft !== false) $options["connecttimeout"] = min($options["connecttimeout"], $timeleft);
if (!function_exists("stream_socket_client"))
{
if ($debug) $fp = fsockopen($protocol . "://" . $host, $port, $errornum, $errorstr, $options["connecttimeout"]);
else $fp = @fsockopen($protocol . "://" . $host, $port, $errornum, $errorstr, $options["connecttimeout"]);
if ($debug) $fp = fsockopen($protocol . "://" . $server, $port, $errornum, $errorstr, $options["connecttimeout"]);
else $fp = @fsockopen($protocol . "://" . $server, $port, $errornum, $errorstr, $options["connecttimeout"]);
}
else
{
Expand All @@ -1381,8 +1380,8 @@ public static function SendSMTPEmail($toaddr, $fromaddr, $message, $options = ar
foreach ($options["sslopts"] as $key => $val) @stream_context_set_option($context, "ssl", $key, $val);
}

if ($debug) $fp = stream_socket_client($protocol . "://" . $host . ":" . $port, $errornum, $errorstr, $options["connecttimeout"], ($async ? STREAM_CLIENT_ASYNC_CONNECT : STREAM_CLIENT_CONNECT), $context);
else $fp = @stream_socket_client($protocol . "://" . $host . ":" . $port, $errornum, $errorstr, $options["connecttimeout"], ($async ? STREAM_CLIENT_ASYNC_CONNECT : STREAM_CLIENT_CONNECT), $context);
if ($debug) $fp = stream_socket_client($protocol . "://" . $server . ":" . $port, $errornum, $errorstr, $options["connecttimeout"], ($async ? STREAM_CLIENT_ASYNC_CONNECT : STREAM_CLIENT_CONNECT), $context);
else $fp = @stream_socket_client($protocol . "://" . $server . ":" . $port, $errornum, $errorstr, $options["connecttimeout"], ($async ? STREAM_CLIENT_ASYNC_CONNECT : STREAM_CLIENT_CONNECT), $context);
}

if ($fp === false) return array("success" => false, "error" => self::SMTP_Translate("Unable to establish a SMTP connection to '%s'.", $protocol . "://" . $server . ":" . $port), "errorcode" => "connection_failure", "info" => $errorstr . " (" . $errornum . ")");
Expand Down

0 comments on commit db97872

Please sign in to comment.