468,554 Members | 1,786 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Share your developer knowledge by writing an article on Bytes.

Sending an email with attachment file

The following program will send the mail with specified attachment file.Need to give the absolute path of the file.

require "rubygems"
require "ruport"
require "ruport/util"

r = Ruport::Report.new

r.add_mailer :default,
:host => "192.168.1.1",
:address => "xxxx@bksys.co.in"

r.send_to("xxxx@bksys.co.in") do |mail|
mail.subject = "Hello"
mail.attach "foo.csv"
mail.text = "This is an email with attached csv file using ruport"
end
Jun 9 '10 #1
0 4568

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Paul Lamonby | last post: by
1 post views Thread by abracad | last post: by
2 posts views Thread by Zameer | last post: by
6 posts views Thread by Piotr Wójcicki | last post: by
reply views Thread by kencana | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.