0
pop = Net::POP3.new mailhost
pop.start mailuser, mailpass
if pop.mails.empty?
puts "Mailbox empty."
else
pop.mails.each do |mail|
if mail.pop.has_attachments?
mail.pop.attachments.each do |attachment|
puts attachment.original_filename
end
end
end
end
給出undefined method 'has_attachments?' for #<String:0xb7cc4f7c>
。如何使用ruby net/pop分離POP3的附件?
是this example不再工作?
嘿@ohho,你能得到這個工作?我正在做一些simlair,我可以做message.head,message.blah並知道試着將附件下載到本地目錄。 TIA。 – zee 2016-09-01 03:28:24