<?
 
require_once('smtp.php');
 
 
$authdata = "";
 
 
$from = "[email protected]";
 
$recip = "[email protected]";
 
$msgdata = `fortune -s`;
 
$headers = "Subject: A test message from " . $argv[0];
 
try {
 
    $smtp = new smtp("localhost",25,$from,$recip,$headers,$authdata,$msgdata);
 
} catch (Exception $e) {
 
    echo "SMTP ERROR: " . $e->getCode() . ": " . $e->getMessage() . " in " . $e->getFile() . "(" . $e->getLine() . ")\n";
 
    exit;
 
}
 
echo "Message sent.\n";
 
?>
 
    
 
 
 |