foreach(keys %emails) { my ($name, $add1, $add2, $city, $zip, $country) = split(/::/, $ +emails{$_}); # Email Subs, special commands my $editmes = $message; # let's not edit $messa +ge $editmes =~ s/\[name\]/$name/g; #[name] = user name $editmes =~ s/\[time\]/$time/g; #[time] = time sent $editmes =~ s/\[unsub\]/$unsub/g; #[unsub] = unsubscribe +email my $editsig = $signature; # let's not edit $signa +ture $editsig =~ s/\[name\]/$name/g; #[name] = user name $editsig =~ s/\[time\]/$time/g; #[time] = time sent $editsig =~ s/\[unsub\]/$unsub/g; #[unsub] = unsubscribe +email my $editsub = $subject; # let's not edit $subje +ct $editsub =~ s/\[name\]/$name/g; # [name] = user name + open( MAIL, "| $sendmail -t" ); print MAIL "To: $_\n"; print MAIL "From: $adminmail\n"; print MAIL "Subject: $editsub\n\n"; print MAIL "$editmes\n"; if ($use ne "" && $signature ne "" ) { print MAIL "$editsig\n"; } print MAIL ".\n"; close(MAIL); }

The problem with this setup is that, if your mailing list contains a vast quantity of recipients, you put a big load on the system/MTA, for you open a connection for each individual recipient. A "better" way to me, would be the use of one e-mail with the recipients listed in the Bcc field. That would dramastically take some load of the script, for this way, only one connection will be made to $sendmail. The script would be faster too :)

But implementing this Bcc way, would take away the "personalized" e-mails system you implemented (the [name] stuff wouldn't work anymore). It's up to anyone, of course, but I would sacrifice the personal touch over the speed increase and load decrease.

I am interested in your motive that made you write this script though. There are some rather good mailing list programs, such as Majordomo (Perl :), Mailman (Python/C) out there already. Not even mentioning googling.

--
b10m

In reply to Re: Mailing List by b10m
in thread Mailing List by sulfericacid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.