From: jackster the jackle Date: 2008-10-22T03:55:39+09:00 Subject: Re: Error Exception if script doesn't run Nobuyoshi Nakada wrote: > I'd rather use popen. > >> rescue Exception => e >> if e >> puts e > > IO.popen("-", "w") do |mail| > mail or exec(*%w"/usr/sbin/sendmail -f my_server@gmail.com > john.smith@email.com") > mail.puts "Subject: Script Error: #{e.backtrace[0]}" > mail.puts > mail.puts e > # and anything what you want to send > end Would you happen to know how to send an attachment using the popen code? thanks jack -- Posted via http://www.ruby-forum.com/.