Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I ran into something similar. My company has a few million customers, and we needed to send out mailings to all, or a portion of the client base, on a semi frequent basis.

I rolled my own solution, as opposed to using a module (Bad me!), but the appropriate answer is multiple rcpt to statements. Then if you want to you can craft your CC header, with all the addresses, or not (which on an aside is exactly how Bcc works, rcpt to recipient with no entry in cc header :)

Off the cuff code to illustrate the point, assuming that if $CC is defined, we will append the addresses, else they are Bcc'd
@users = &Get_Users_from_Db("$some_db"); while ( defined($usr = shift(@users)) ) { chomp($usr); # # Assume the rcpt and send methods appropriatly process the # reponse from the server also here we would add error # checking for properly formated email addie. # $smtp->rcpt("$usr"); $cc_head ? $cc_head .= ", $usr" : $cc_head = "$usr"; } print $smtp->send("DATA"); # # At this point we talk directly to the socket because the # smtp server does not repond with anything till we are done # $socket = $smtp->socket(); print $socket "From: $from\n"; print $socket "To: $list_name\n"; print $socket "CC: $cc_head\n" if ($CC && $cc_head); print $socket "Subject: $subject\n\n"; print $socket "@message_body\n\n"; $ok = $smtp->send('.'); &Some_Error_Routine("sending mail") if (!$ok);
Its just a basic rundown, but it shows the point. Also Ive had great results using Perl, and like I said I send emails in the millions, so 500 is a breeze. Also again I do not know the particulars of the modules implementation, but assume it was written by a far wiser man than I. It should support the rcpt or rcpt_to or something similar. Just make sure that if you are trying to Bcc the list that the module isnt going to append that info to the headers of the data section.

Happy hacking, and on a quasi OT comment 'death to spammers'.. ;)

/* And the Creator, against his better judgement, wrote man.c */

In reply to Re: Email lists (the Righteous sort) by l2kashe
in thread Email lists (the Righteous sort) by George_Sherston

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found