I have a trouble with sending email message with attachment using ActionMailer.
The thing is my attachment has 'noname' filename when I reading my message in gmail.
Notifier function
class Notifier < ActionMailer::Base
def send_message
attachments["text.txt"] = {:content => "hello"}
mail(:to => "[email protected]", :subject => 'test')
end
end
Message headers:
Date: Sun, 19 Dec 2010 23:18:00 +0100 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; filename=text.txt Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=text.txt Content-ID: ...
How can I send a message with right filename?
Thanks