Image attachment in mail with rails3

yes this will send one mail with attachment of image.png. But when i
open
or download that image, that is empty.?

imageurl =
https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=5&choe=UTF-8
require ‘open-uri’
class UserMailer < ActionMailer::Base
default :from => “[email protected]

def welcome_email(imageurl,mailid)

attachments['QR.png'] = {:mime_type => 'image/png',
                                 :content => 

open(URI.parse(imageURL))}
mail(:to => mailid,
:subject => “Code”,
:body => “Code”)
end
end

Thanks
vishnu

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs