From: grooveska Date: 2007-06-08T06:25:03+09:00 Subject: Re: Help with emailing attachments with Ruby... That looks awesome. Nice and simple. I'm going to give that a try. Thanks!! On Jun 7, 2:48 pm, "Gregory Brown" wrote: > On 6/1/07, grooveska wrote: > > > I am working on a script that will send an email with a .csv file > > attachment. I can get everything set correctly, and the email gets > > sent properly. The problem is with the attachments. This maybe a MIME > > thing instead of something wrong with my script. My script is based > > on an example from Hal Fulton's The Ruby Way book. If anyone has any > > suggestions or see something I did wrong I would greatly appreciate > > it. > > Hi, with ruport-util, that looks like this: > > require "rubygems" > require "ruport" > require "ruport/util" > > r = Ruport::Report.new > > r.add_mailer :default, > :host => "mail.adelphia.net", > :address => "gregory.t.br...@gmail.com" > > r.send_to("gregory.t.br...@gmail.com") do |mail| > mail.subject = "Hello" > mail.attach "foo.csv" > mail.text = "This is an email with attached csv" > end > > I understand if you want to lighten the dependency load, so you might > just want to use the lib we wrap, MailFactory.