Hi,
I''m using the ActionMailer as seen in
http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer
for a simple Newsletter-Skript
+ I have a multipart form.
+ I have a simple input type="file" upload field
+ I can send my newsletters without attachments.
How can I store the uploaded file temporarily in a folder uploads, an
send it attached with my newsletter? ''Cause the file is not being
saved when following the instructions under Attachements...
--------subject-controller----------------------
def newsletter
[....]
@nlattachment = @params[''nlattachment'']
mail = Newsletter::create_my_mail(@subject ...)
mail.set_content_type(''multipart'', blah blah) #hell, what
does
blah blah mean?
mail.parts << @nlattachment
Newsletter::deliver(mail)
end
-------------newsletter-model-------------------
def alumni_newsletter( subject, nlattachment....)
@body["nlattachment"] = nlattachment
attachment :content_type => "image/gif",
:body =>
File.read("uploads/#{@body[''nlattachment'']}")
def
----------------------------------------------------------
Thanks again for your help
- Marten