begin content = open(attachment, 'rb') { |io| io.read } basename = File.basename(attachment) puts "Sending file #{basename} #{content.length} to #{to}" mail = Pony.mail( :via => :smtp, :via_options => { :address => 'smtp.gmail.com', :port => '587', :enable_starttls_auto => true, :user_name => 'us...@host.com', :password => 'password', :authentication => :plain, :domain => 'host.com' }, :to => to, :from => from, :subject => subject, :html_body => message, :body => '', :attachments => { basename => content }, :headers => { 'Content-Type' => 'multipart/mixed', 'Content-Transfer-Encoding' => 'base64', 'Content-Disposition' => 'attachment' } ) rescue Exception => ex log.error "Error posting email", ex return ex.message end if defined? Pony
--
---
You received this message because you are subscribed to the Google Groups "Ponyrb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What happens when you run it under ruby not JRuby? Have you tried using strace on the process?
How much free RAM is there when the CPU is pegged? Possibly a swap issue?