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
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
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.