# Sending email w/ attachments

**URL:** <https://rubytalk.org/t/sending-email-w-attachments/18076>\
**Category:** ruby-talk\
**Created:** [3 May 2005 02:14 UTC](https://rubytalk.org/t/sending-email-w-attachments/18076 "2005-05-03T02:14:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Wernsing](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Mike\_Wernsing](https://rubytalk.org/u/Mike_Wernsing)\
**Post date:** [3 May 2005 02:14 UTC](https://rubytalk.org/t/sending-email-w-attachments/18076/1 "2005-05-03T02:14:25Z")

</div>

I have been following the following how-to with no success:

> **[Ruby on Rails](http://rubyonrails.org)**
>
> A web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

The following section is what seems to be giving me trouble:

mail.set\_content\_type('multipart', blah blah)  
mail.parts \<\< my\_attachment

Questions:  
1) Am I setting the content type for the attachment I am about to append?  
2) What is my\_attachment supposed to be, a filesystem object?

Ultimately the script is failing at this portion of code:

Mailer::deliver(mail)

With the following error message:

undefined method `accept' for \<File:/path/to/file\>

Any help would be much appreciated.
