function mailit($mail_server, $mail_port, $address_from, $address_to, $Subject, $text) { $f = fsockopen($mail_server, $mail_port); fgets($f, 256); fputs($f, "helo gis.de\n"); fgets($f, 256); fputs($f, "mail from:<$address_from>\n"); fgets($f, 256); fputs($f, "rcpt to:<$address_to>\n"); fgets($f, 256); fputs($f, "data\n"); fgets($f, 256); fputs($f, "From: $address_from\n"); fputs($f, "To: $address_to\n"); fputs($f, "Subject: $Subject\n"); fputs($f, "\n"); fputs($f, "$text\n"); fputs($f, ".\n"); fgets($f, 256); fputs($f, "quit\n"); fgets($f, 256); fclose($f); return 0; } ?> if ($argv[0]=="sendit") { if ($Address=="") { echo "No e-mail address given. e-mail not sent."; exit; } else { mailit("localhost", 25, $Address, "bjoern@gis.de", $Subject, $Message); } } ?>