I've checked through the documentation for ActionMailer.
Reusing the example they list in their documentation I now have:
def message(sent_at = Time.now)
subject 'New message'
attachment "image/jpg" do |a|
a.body = File.read("public/images/test.jpg")
a.filename = "hello.jpg"
test.jpg exists in the folder public/images and is definitely a jpg.
In my previous post I had configured my app to use the mail transfer
agent on my production server (presumably sendmail).
To eliminate this as being the problematic link in the chain I also
configured my rails app to use my gmail account to send the email.
Again the mail generated in my rails app gets delivered, but with the
image attachment I get exactly the same result (jpg doesn't display
inline and when I download it and try to open it I get the message "File
Could anyone give me a clue as to what I am doing wrong?