请教 为什么ruby 我发邮件 带附件后 收到的邮件附件是0字节。
ruby吧
全部回复
仅看楼主
level 5
is_lidya 楼主

ActionMailer::Base.smtp_settings = {
:address => "......",
:port => 2,
:domain => "smtp.......com",
:authentication => :login,
:user_name =>...,
:password => ".......",
}
attachments[shippment.ship_attachment_file_name] = File.read("#{Rails.root}"+File::SEPARATOR+"public"+shippment.ship_attachment_file.url)
mail(:from =>...,:to=>[email protected],:subject => "ORDER")
2014年02月20日 01点02分 1
level 5
is_lidya 楼主
为什么收到的附件是0字节
2014年02月20日 01点02分 2
level 9
attachments[shippment.ship_attachment_file_name] = 后面的内容,打印一下.size 和 .class
2014年02月24日 05点02分 3
可以了 谢谢
2014年02月25日 02点02分
1