Rudolf has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I'm currently pondering a perl script that can mass email clients from a database.. this is what I have so far but I'm very unsure what the best method of actually sending the email is. I want to be able to send HTML e-mail's with a gmail account I have created.

my @email_list = (); open(LIST,'<',"email_database.txt") or die "$!\n"; while(<LIST>){ chomp $_; push(@email_list,$_); } close(LIST); foreach my $address(@email_list){ sendmail($address); } sub sendmail{ my $address = $_[0]; # what should I use here? if( mail was sent ) {return true} }

Replies are listed 'Best First'.
Re: mass emailing perl scrpt
by Lady_Aleena (Priest) on Jan 05, 2012 at 03:25 UTC

    I did a little search on CPAN and found Email::Send::Gmail. That could help you.

    Have a cookie and a very nice day!
    Lady Aleena
Re: mass emailing perl scrpt
by tobyink (Canon) on Jan 05, 2012 at 09:09 UTC

    What do you mean "from" a Gmail account? From addresses in e-mail are like the From address you might write on the back of an envelope when sending snail mail. You can write anything you like - nobody verifies it.

    Mail::Sendmail is reasonably simple to use - all you need is an SMTP server to point it at.

Re: mass emailing perl scrpt
by Anonymous Monk on Jan 05, 2012 at 05:16 UTC

    the best method of actually sending bulk email is

    A fools errand :)