Public feed #527044

Miscellany

public text v1 · immutable
Raw Edit
·published 2007-06-01 04:04 UTC
rendered paste body
[root@w7 public_html]# cat test3.php
<?php
$smtp_server = "127.0.0.1";
//$smtp_server = "65.38.105.132";
$port = 25;
$mydomain = "ksclub.org";
$sender = "astronomy@ksclub.org";
$recipient = "larry@eleven2.com";
$subject = "the subject";
$content = "the message";

// SMTP connection

$handle = fsockopen($smtp_server,$port);
fputs($handle, "HELO $mydomain\r\n");

// Send out the e-mail
fputs($handle, "MAIL FROM: <$sender>\r\n");
fputs($handle, "RCPT TO: <$recipient>\r\n");
fputs($handle, "DATA\r\n");
fputs($handle, "From: <$sender>\r\n");
fputs($handle, "To: <$recipient>\n");
fputs($handle, "Subject: $subject\n\n");
fputs($handle, "$content\r\n");
fputs($handle, ".\r\n");

// Close connection to SMTP server
fputs($handle, "QUIT\r\n");
?>
[root@w7 public_html]#