#!/usr/bin/perl -s # Author : Premson P R # Description : To Send Mail to a mail server using simple SOCK function use Socket; $SMTP = '10.18.1.97'; $From = 'jinumathewjoy@yahoo.com'; $To = 'premson_pr@yahoo.com'; $Subject = 'Using 97 address and ems'; $Message = 'As expected ..... a general DABBA answer? Anonymous DCEer.'; &Send_Mail; sub Send_Mail { socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp')); connect(SOCK, sockaddr_in(25, inet_aton($SMTP))); send(SOCK, "helo mail.premson.net\r\n", 0); $Response = ; send(SOCK, "mail from: <$From>\r\n", 0); $Response = ; send(SOCK, "rcpt to: <$To>\r\n", 0); $Response = ; send(SOCK, "data\r\n", 0); $Response = ; send(SOCK, "To: $To\r\n", 0); send(SOCK, "From: $From\r\n", 0); send(SOCK, "Reply-To: $From\r\n", 0); send(SOCK, "X-Mailer: DCE Agent\r\n", 0); send(SOCK, "Subject: $Subject\r\n\r\n", 0); send(SOCK, "$Message\r\n\r\n", 0); send(SOCK, ".\r\n", 0); $Response = ; send(SOCK, "quit\r\n", 0); $Response = ; close(SOCK); }