Sending email w/ attachments

M

Mike Wernsing

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

http://wiki.rubyonrails.com/rails/show/HowToSendEmailsWithActionMailer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,938
Members
47,473
Latest member
pioneertraining

Latest Threads

Top