getRemoteName (), "\n"; }); // Create a new SMTP-Client require_once ('qcEvents/Client/SMTP.php'); $Client = new qcEvents_Client_SMTP ($Base, $Mailserver, $Port); if ($Username !== null) $Client->setCredentials ($Username, $Password); $Client->sendMail ( $From, $Receivers, 'Subject: Test' . "\r\n\r\n" . 'This is a test', function (qcEvents_Client_SMTP $Client, $Status) { if ($Status) echo 'E-Mail was sent successfully', "\n"; else echo 'E-Mail could NOT be sent', "\n"; exit (); } ); #qcEvents_Client_SMTP::$debugHooks = true; # #$Client->addHook ('smtpCommand', function ($Client, $Verb, $Params, $Command) { # echo '> ', $Command, "\n"; #}); #$Client->addHook ('smtpResponse', function ($Client, $Code, $Lines) { # foreach ($Lines as $Line) # echo '< ', $Code, ' ', $Line, "\n"; #}); # #// Try to create a connection with our mailserver #$Client->connect ($Mailserver, $Port, $Username, $Password, function (qcEvents_Client_SMTP $Client, $Hostname, $Port, $Username = null, $Status) { # // Check if the connection was established # if (!$Status) # die ('Failed to connect to ' . $Hostname . "\n"); # # die ('Todo...' . "\n"); #}); // Meanwhile enter main-loop $Base->loop (); ?>