るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.092秒)

別のキーワード

  1. net/smtp start
  2. net/imap name
  3. net/imap param
  4. net/http get
  5. net/pop pop

ライブラリ

クラス

キーワード

検索結果

net/pop (38120.0)

このライブラリは、POP3 (Post Office Protocol version 3) を 用いてPOPサーバからメールを受信する機能を提供するライブラリです。

...'YourPassword' は適当なアカウント名とパスワード
に適宜読みかえてください。

require 'net/pop'

pop = Net::POP3.new('pop.example.com', 110)
pop.start('YourAccount', 'YourPassword') # POPのセッションを開始
if pop.mails.empty?
$stderr.puts 'no mail.'...
...るにはその前に開始手続きを、
終わったら終了手続きを、行わなければいけません。
それを行うのが Net::POP3#start と Net::POP3#finish で、
POP3 オブジェクトはその二つのメソッドの間でだけ有効になります。

サーバ上のメール...
...ドを避けたためにかなり冗長です。
まず、ブロック付きの Net::POP3.start を使うことで
POP3.new, #start, #finish を併合できます。

require 'net/pop'

Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPassword') {|pop|
if pop.m...

Net::POP3.start(address, port = nil, account=nil, password=nil, isapop=false) -> Net::POP3 (26138.0)

Net::POP3 オブジェクトを生成し、サーバへ接続します。

...995)を
使います。

以下のコードと同じ動作をします。
require 'net/pop'

Net::POP3.new(address, port, isapop).start(account, password)

使用例:

require 'net/pop'

Net::POP3.start(addr, port, account, password) {|pop|
pop.each_mail do |m|
file.write m.pop...
...バがAPOPを提供していない場合に発生します
@raise Net::POPError サーバが認証失敗以外のエラーを報告した場合に発生します
@raise Net::POPBadResponse サーバからの応答がプロトコル上不正であった場合に発生します

@see Net::POP3#start...

Net::POP3.start(address, port = nil, account=nil, password=nil, isapop=false) {|pop| .... } -> object (26138.0)

Net::POP3 オブジェクトを生成し、サーバへ接続します。

...995)を
使います。

以下のコードと同じ動作をします。
require 'net/pop'

Net::POP3.new(address, port, isapop).start(account, password)

使用例:

require 'net/pop'

Net::POP3.start(addr, port, account, password) {|pop|
pop.each_mail do |m|
file.write m.pop...
...バがAPOPを提供していない場合に発生します
@raise Net::POPError サーバが認証失敗以外のエラーを報告した場合に発生します
@raise Net::POPBadResponse サーバからの応答がプロトコル上不正であった場合に発生します

@see Net::POP3#start...

Net::POP3.new(address, port = nil, apop = false) -> Net::POP3 (26107.0)

Net::POP3 オブジェクトを生成します。

...す。

port に nil を渡すと、適当なポート(通常は110、SSL利用時には 995)を
使います。

@param address POP3サーバのホスト名文字列
@param port 接続するPOP3サーバのポート番号
@param apop 真の場合にはAPOPで認証します

@see Net::POP3#start...

Net::POP3#set_debug_output(f) -> () (8018.0)

デバッグ用の出力 f をセットします。

...なければなりません。

使用例:

require 'net/pop'

pop = Net::POP3.new('pop.example.com', 110)
pop.set_debug_output $stderr
pop.start('YourAccount', 'YourPassword') {
p pop.n_bytes
}

実行結果:

POP session started: pop.example.com:110 (POP)
-> "+OK popd <1162042773...

絞り込み条件を変える

Net::POP3.APOP(is_apop) -> Class (8018.0)

bool が真なら Net::APOP クラス、偽なら Net::POP3 クラスを返します。

...bool が真なら Net::APOP クラス、偽なら Net::POP3 クラスを返します。

使用例:

require 'net/pop'

pop = Net::POP3::APOP($isapop).new(addr, port)
pop.start(account, password) {
....
}

@param is_apop 真の場合に Net::APOP を返します。...