【发布时间】:2013-05-10 20:19:37
【问题描述】:
这是我的邮件:
class MailIt < ActionMailer::Base
def funny(sender)
@sender = sender
attachments['funny.pdf'] = File.read("#{Rails.root}/app/assets/funny.pdf")
mail(:to => "amail@example.com",
:from => "amail@example.com",
:subject => "TESST")
end
end
我收到了附有 pdf 的电子邮件,但它已损坏,文件大小仅为原始文件的 1/4。
【问题讨论】:
-
是的窗口。好像是编码问题……
-
我猜的,因为我在 UNIX 中使用完全相同的代码没有问题。编码,二进制模式问题,谁知道呢……
标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.1