⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (480 Bytes)
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
« Previous
1
2
Next »
(1-1/2)
Loading...