in reply to Sending mail to multiple users using MIME

The lines

foreach (@arr){ $users.= '$_.@gmail.com', }
are incorrect, the string is in single quotes and so $_ is not interpolated. They should be replaced with
$users = join ', ', @arr;

Replies are listed 'Best First'.
Re^2: Sending mail to multiple users using MIME
by Ultra (Hermit) on Jan 28, 2008 at 09:21 UTC

    More than that, you should send the email 'To' one address, and CC (or BCC) to one or multiple email addresses.

    Replacing ' with "" you will send emails to 'foo@gmail.combar@gmail.comkaboom@gmail.com' which I guess you can figure out is wrong :)

    What you should do is to send the email 'To: one@email.address.here' and 'CC: to@one.address.here, the.second@one.here' and so on ...

    Just have a look at MIME::Lite examples

    Dodge This!