in reply to eof without closing the pipe
This works becuase it doesnt quit the sendmail connection till after all the emails have been sent to each person in your @users array seperatly.#!/usr/bin/perl use strict; use Socket; my @users=('email1@server.com', 'email2@server.com', 'email3@server.co +m'); 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);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: eof without closing the pipe
by c-era (Curate) on Jun 30, 2000 at 15:47 UTC | |
|
RE: RE: eof without closing the pipe
by eduardo (Curate) on Jun 30, 2000 at 17:05 UTC | |
by lhoward (Vicar) on Jun 30, 2000 at 17:12 UTC | |
by eduardo (Curate) on Jun 30, 2000 at 18:02 UTC | |
by gryng (Hermit) on Jun 30, 2000 at 18:51 UTC | |
|
RE: RE: eof without closing the pipe
by t0mas (Priest) on Jun 30, 2000 at 10:18 UTC |