Skip to content

Instantly share code, notes, and snippets.

@aont
Created June 11, 2012 01:35
Show Gist options
  • Select an option

  • Save aont/2908025 to your computer and use it in GitHub Desktop.

Select an option

Save aont/2908025 to your computer and use it in GitHub Desktop.
IMAP upload
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'time'
require 'net/imap'
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.login('user@gmail.com', 'password')
File::open("mail.txt") do |f|
imap.append("INBOX", f.read, nil, Time::parse("2012/6/7"))
end
imap.logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment