[Rails] Inline attachment
Hi All
I followed this link http://blog.thoughtobject.com/2007/05/26/5/ and
installed inline-attachment for attaching image files in my mails.
But when i add this
@cid = Time.now.to_f.to_s + "lightbulb.png@domain.com"
inline_attachment :content_type => "image/png",
:body =>
File.read("#{RAILS_ROOT}/public/images/lightbulb.png"),
:filename => "lightbulb.png",
:cid => "<#{@cid}>"
in model emailer.rb
I get only this image in the mail
ie,even if i add some static content to html.erb as well as display some
of the dynamic data which i pass through,
recipients to_addr
from "user@userdomian.com"
subject subj
body :cid => @cid, :message => msg, :name => to_name
content_type "text/html"
and use
<img src="cid:#{@cid}" />
in the html.erb file,
I get only the image without any text.
But in case,I remove this inline_attachment part
inline_attachment :content_type => "image/png",
:body =>
File.read("#{RAILS_ROOT}/public/images/lightbulb.png"),
:filename => "lightbulb.png",
:cid => "<#{@cid}>"
and try without <img src="cid:#{@cid}" />
in the html.erb file, the text are all coming .
I am not able to figure out whats wrong.Kindly help me in cracking this.
Thanks In Advance.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home