Forum: Ruby on Rails email attachment is not sending properly

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
784e13ffb781304767843b78044c70b8?d=identicon&s=25 abhishek (Guest)
on 2007-02-10 06:49
hi friends,

i m trying to send attachment with my mail. its an image file(.jpeg).
but when i check my inbox it shows me image file as binary contents in
tha mail itself. its not showing me an attachment.
please help me.

code in my model is:

class MyMailer < ActionMailer::Base
  def sent(msg)
    @subject = "Abc here...!"
    @recipients = ""
    @from = ""
    @sent_on =
    #content_type "text/html"
    @body = {}

    part :content_type => 'text/html',
         :body => msg

    attachment :content_type => "image/jpeg",
               :filename =>
               :body =>"#{RAILS_ROOT}/public/images/product_images/14imagesh1.jpeg")
This topic is locked and can not be replied to.