Exemple #1
0
<?php

define('output', 'html');
require_once __DIR__ . '/../../core/core.php';
Req('class/telnet_tester.class.php', __DIR__);
echo www::ScriptHead('Telnet Tester');
if (!isset($_POST['ip'])) {
    $F = new FORMS('TelNetTest', 'Telnet Email Testing', false, 500);
    $F->Text('ip', ['IP Address' => false], false);
    $F->Text('ehlo', ['EHLO' => false], false);
    $F->Text('mailfrom', ['Mail From' => false], false);
    $F->Text('to', ['To' => false], false);
    $F->Text('from', ['From' => false], false);
    $F->Text('subject', ['Subject Line' => false], false);
    $F->write('<b style="padding:25px 0px 0px;">Additional Headers</b>');
    $F->Textarea('headers', false, false, 460, 100);
    $F->write('<b style="padding:25px 0px 0px;">Body</b>');
    $F->Textarea('body', false, false, 460, 250);
    $F->Button('TelNetTest', 'send test');
    $F->JS("\$('button#TelNetTest').click(function(){\n    var ip = \$('#ip').val();\n    var ehlo = \$('#ehlo').val();\n    var from = \$('#from').val();\n    var to = \$('#to').val();\n    var mailfrom = \$('#mailfrom').val();\n    var headers = \$('#headers').val();\n    var subject = \$('#subject').val();\n    var body = \$('#body').val();\n    \$('td#results').html('<h3>Working... Please Wait...</h3>');\n    \$.post(window.location.href,{ip:ip,ehlo:ehlo,from:from,to:to,mailfrom:mailfrom,headers:headers,body:body,subject:subject},function(data){\n      \$('td#results').html(data);\n    });\n  });");
    $F = $F->PrintForm();
    echo www::Alt("\n    <table>\n      <tr>\n        <td>" . $F . "</td>\n        <td id=\"results\"></td>\n\t    </tr>\n    </table>");
} else {
    $TNT = new TelNetTest($_POST);
    $TNT->SendMail();
}