<?
require_once('smtp.php');
$authdata = "";
$from = "joe@test.com";
$recip = "jay@test.com";
$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";
?>
|