#!/usr/bin/perl use strict; use Socket; my @users=('email1@server.com', 'email2@server.com', 'email3@server.com'); my $mailhost="localhost"; my $myemail="mark\@cidera.com"; # Your email address # this is just the subject and body of the message # you can get this information from anywhere I just # put it in here for the sake of example my $subject= "hi"; my $data = "hi hi hi hi there"; my $userz; socket(MAIL,PF_INET,SOCK_STREAM,getprotobyname('tcp')); connect(MAIL,sockaddr_in(25,inet_aton($mailhost))); select(MAIL); $|=1; select('stdout'); print MAIL "HELO blah.com\n"; foreach $userz (<@users>) { print MAIL "MAIL FROM: $myemail\n"; print MAIL "RCPT TO: $userz\n"; print MAIL "DATA\n"; print MAIL "Subject: $subject\n"; print MAIL "$data\n"; print MAIL ".\n"; } print MAIL "quit\n"; close(MAIL);