/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env ruby require "rubygems" require "appscript" include Appscript require "active_support" mail = app("Mail") accounts = {"Personal" => "INBOX", "Both Pieces IMAP" => "INBOX", "Exchange" => "INBOX"} accounts.each do |acct,box| account = mail.accounts[acct].get inbox = account.mailboxes[box].get messages = inbox.messages[its.flagged_status.eq(true).and( its.date_received.gt(Time.now - 3.days) )].get messages.each do |m| puts m.subject.get end end