Re: Image Email Attachments Not Working

Andrew Stewart
2007-04-18T11:34:19Z

On 17 Apr 2007, at 18:46, Adam J. wrote:
> I''m been struggling with an email attachment problem for a few
weeks
> now. I can''t seem to get image attachments in an email to work.
I''d
> receive the email fine, but the actual image in the attachment is
> broken
> (the actual image data never gets sent).
[snip]
> Mailer model
> -------------------------------------------
> def images_with_attachments()
>      @subject = "test Subject
>      @body = {:body => "this is testing text"}
>      @recipients =
"two2twelve-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
>      @from = "support-evKWb0oGzzpWk0Htik3J/w@public.gmane.org"
>   attachment :content_type => "image/jpg", :filename =>
> "TestImage.jpg",
> :body => File.read(RAILS_ROOT +
"/public/images/TestImage.jpg")
> end

According to the documentation[1], the :content_type should be "image/
jpeg" not "image/jpg".  Perhaps that''s the problem?

And is the :filename necessary?

Regards,
Andy Stewart

[1] http://api.rubyonrails.org/classes/ActionMailer/Base.html

--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---