On Sep 17, 2005, at 2:06 PM, Kyle Maxwell wrote:
> I''m following the ActionMailer manual code (below), and when I
send an
> email with an attachment, it does not have a filename associated with
> the attachment. I can''t for the life of me figure out how to
attach a
> named file. Can someone please help me?
>
> Thanks,
> Kyle Maxwell
>
> # attachments
> def signup_notification(recipient)
> recipients recipient.email_address_with_name
> subject "New account information"
> from
"system-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org"
>
> attachment :content_type => "image/jpeg",
> :body => File.read("an-image.jpg")
> end
You just need to specify a :filename value:
attachment :content_type => "image/jpeg",
:body => File.read("an-image.jpg"),
:filename => "an-image.jpg"
Good luck,
- Jamis