Here i need to attach one image with mail, the passing image like this
**imageurl** = "https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=%22hai%22&choe=UTF-8"
class UserMailer < ActionMailer::Base
default :from => "mail@example.com"
def welcome_email(**imageurl**,bname,mailid)
**attachments['image.png'] = File.read(imageURL)**
mail(:to => mailid,
:subject => "Code for "+bname+"",
:body => "code for bname" )
end
end
end
here i got some attachment error. Have any changes in this attachment?
thanks
i think you have a URL i.e a string which File.read cannot read.
The above should do the trick i think.