ruport-how to send email to multiple recipients

I have this script but currently it only send email to one recipient. Someone knows how to send email to multiple recipients? Please help.

require 'ruport' require 'ruport/util'

r = Ruport::Report.new r.add_mailer :default,                  :host => "mail.host.com",                  :address => "address@host.com"

r.send_to("to@host.com") do |mail|   mail.subject = "Test Report"   mail.attach "test_file.txt"   mail.text = "This is an email with attached txt" end

Thanks!

help please.

Hi Marlon

require 'ruport' require 'ruport/util'

r = Ruport::Report.new r.add_mailer :default,                  :host => "mail.host.com",                  :address => "address@host.com"

r.send_to("to@host.com") do |mail|   mail.subject = "Test Report"   mail.attach "test_file.txt"   mail.text = "This is an email with attached txt" end

   Try like recipients = ["to1@host.com","to2@host.com",....] recipients.each do |recipient| r.send_to(recipient) do |mail|    mail.subject = "Test Report"    mail.attach "test_file.txt"    mail.text = "This is an email with attached txt" end end

Sijo

Thanks for helping Sijo

Hi Marlon   Another easy way also there.

recipients = ["to1@host.com","to2@host.com",....] r.send_to(recipients) do |mail|    mail.subject = "Test Report"    mail.attach "test_file.txt"    mail.text = "This is an email with attached txt" end

     Just test this

Sijo

Try like recipients = ["t...@host.com","t...@host.com",....] recipients.each do |recipient| r.send_to(recipient) do |mail| mail.subject = "Test Report" mail.attach "test_file.txt" mail.text = "This is an email with attached txt" end end

So, I'm guessing that something like the following could also be done:

Mailinglist.find(:all).each do |ml_record| r.send_to(ml_record.address) blah blah

Would this be the appropriate way to handle a mailing list? Is there some other way I should consider? If we get a few thousand addresses returned, is that going to be a problem? Thanks.

       ... doug