使用ActionMailer发送带附件的电子邮件时遇到问题.
当我在gmail中阅读我的消息时,我的附件有'noname'文件名.
通知功能
class Notifier < ActionMailer::Base
def send_message
attachments["text.txt"] = {:content => "hello"}
mail(:to => "me@gmail.com", :subject => 'test')
end
end
Run Code Online (Sandbox Code Playgroud)
邮件标题:
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: ...
如何发送具有正确文件名的邮件?
谢谢