示例#1
0
function mx_mbx()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $tb = explode("@", $_GET["recipient"]);
    $t = $_GET["t"];
    $mx = unserialize(base64_decode($_GET["mx"]));
    $users = new usersMenus();
    $newarray = array();
    $smtp = new smtp();
    while (list($ip, $ipaddr) = each($mx)) {
        $params = array();
        $img = "ok24.png";
        $error = null;
        $params["timeout"] = 2;
        $params["host"] = $ipaddr;
        $params["port"] = 25;
        $params["helo"] = $users->hostname;
        $params["DonotResolvMX"] = true;
        $error = "{success}";
        if (!$smtp->connect($params)) {
            $img = "error-24.png";
            $error = "{unable_to_smtp_connect}:<br>" . ParseErrorsArray($smtp->errors);
        } else {
            if (!$smtp->mail($_GET["sender"])) {
                $img = "error-24.png";
                $error = "{unable_to_smtp_mailfrom}:<br>" . ParseErrorsArray($smtp->errors);
            } else {
                if (!$smtp->rcpt($_GET["recipient"])) {
                    $img = "error-24.png";
                    $error = "{unable_to_smtp_mailto}:<br>" . ParseErrorsArray($smtp->errors);
                }
            }
        }
        $smtp->quit();
        echo "<table style='width:99%;margin-top:10px' class=form>";
        echo $tpl->_ENGINE_parse_body("<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$img}'></td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{transaction}:\n\t\t\t<div style='font-size:12px'>{$ipaddr} -&raquo; {$_GET["sender"]} -&raquo; {$_GET["recipient"]}</div> {$error}</td>\n\t\t\t</tr>");
    }
    echo "</table>{$script}";
}