Maybe Most efficient way to send mass email?

Most people use MiME::Lite to avoid those hassles. I think the preferred way to do it is with a Bcc list, but your ISP may think you are spamming.

#! /usr/bin/perl -w # #This program takes a list of email addresses and emails them. #NOTE: This program must be changed for each edition of the newsletter # use strict; use MIME::Lite; open(INDEX, "<index.htm") or die "Can't open index.htm file"; my $body = do { local $/; <INDEX> }; #Slurp the whole file in close(INDEX); my $msg = MIME::Lite->new( Subject =>'New phase of funding to support life-saving vaccines +', Type =>'multipart/related', ); $msg->attach(Type =>'text/html', Data =>$body, Disposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/Hivheader1.jpg', +Disposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/image001.jpg', Di +sposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/image002.jpg', Di +sposition=>'inline'); $msg->attach(Type =>'image/gif', Path =>'index_files/image003.gif', Di +sposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/image004.jpg', Di +sposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/image005.jpg', Di +sposition=>'inline'); $msg->attach(Type =>'image/jpg', Path =>'index_files/image006.jpg', Di +sposition=>'inline'); while (<>) { $msg->add(To=>"$_"); $msg->send("sendmail","/usr/bin/qmail-inject"); }; #while there are more address on the command line

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: sendmail with perl by zentara
in thread sendmail with perl by mwhiting

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.