Project

General

Profile

Bug #4249 » imap_test.rb

niw (Yoshimasa Niwa), 01/07/2011 10:06 PM

 
#!/usr/bin/env ruby
# encoding: UTF-8

require 'net/imap'

Net::IMAP.debug = true

EMAIL = <<END_OF_RAW_EMAIL
Subject: test
From: Yoshimasa Niwa <niw@niw.at>
To: Yoshimasa Niwa <niw@niw.at>

こんにちわ、丹羽です。
END_OF_RAW_EMAIL
.gsub(/\r?\n/, "\r\n")

begin
imap = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)
imap.login("username", "password")
imap.append("Imported", EMAIL) # => S: RUBY0002 BAD Could not parse command
ensure
imap.disconnect
end
(1-1/2)