るりまサーチ

最速Rubyリファレンスマニュアル検索!
672件ヒット [1-100件を表示] (0.062秒)
トップページ > クエリ:-[x] > クエリ:net/smtp[x]

別のキーワード

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

検索結果

<< 1 2 3 ... > >>

net/smtp (38078.0)

メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol) を扱うライブラリです。

...うに終端処理を自動的にやってくれる
のでおすすめです。

require 'net/smtp'
Net::SMTP.start( 'smtp.example.com', 25 ) {|smtp|
# use smtp object only in this block
}

smtp-server.example.com は適切な SMTP サーバのアドレスに読みかえてください。...
...require 'net/smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.send_message(<<-EndOfMail, 'from@example.com', 'to@example.net')
From: Your Name <from@example.com>
To: Dest Address <to@example.net>
Subject: test mail
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <uniq...
...なければいけません。
File のように GC 時に勝手に close されることもありません。

# using SMTP#finish
require 'net/smtp'
smtp = Net::SMTP.start('smtp.example.com', 25)
smtp.send_message mail_string, 'from@example.com', 'to@example.net'
smtp.finish

またブ...

Net::SMTP#auth_cram_md5(user, secret) -> () (8116.0)

CRAM-MD5 認証を行います。

...CRAM-MD5 認証を行います。

このメソッドはセッション開始(Net::SMTP#start)後、
メールを送る前に呼びだしてください。

通常は Net::SMTP.start や Net::SMTP#start で認証を
行うためこれを利用する必要はないはずです。

@param user 認証...

Net::SMTP#capable_cram_md5_auth? -> bool (8116.0)

サーバが AUTH CRAM-MD5 を広告してきた場合に真を返します。

...サーバが AUTH CRAM-MD5 を広告してきた場合に真を返します。

このメソッドは Net::SMTP#start などでセッションを開始
した以降にしか正しい値を返しません。...

Net::SMTP.start(address, port = Net::SMTP.default_port, helo = &#39;localhost&#39;, user = nil, password = nil, authtype = DEFAULT_AUTH_TYPE) -> Net::SMTP (8112.0)

新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。

...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo, user, password, authtype)

このメソッドにブロックを与えた場合には、新しく作ら...
...ます。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。

Example:

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string, 'from@example.jp', 'to@example.jp'
}

@param address 接続...
...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)

このメソッドにブロックを与え...

Net::SMTP.start(address, port = Net::SMTP.default_port, helo = &#39;localhost&#39;, user = nil, password = nil, authtype = DEFAULT_AUTH_TYPE) {|smtp| .... } -> object (8112.0)

新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。

...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo, user, password, authtype)

このメソッドにブロックを与えた場合には、新しく作ら...
...ます。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。

Example:

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string, 'from@example.jp', 'to@example.jp'
}

@param address 接続...
...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)

このメソッドにブロックを与え...

絞り込み条件を変える

Net::SMTP.start(address, port = Net::SMTP.default_port, tls_verify: true, tls_hostname: nil, helo: &#39;localhost&#39;, user: nil, password: nil, authtype: DEFAULT_AUTH_TYPE) -> Net::SMTP (8112.0)

新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。

...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)

このメソッドにブロックを与え...
...ます。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。

Example:

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string, 'from@example.jp', 'to@example.jp'
}

@param address 接続...

Net::SMTP.start(address, port = Net::SMTP.default_port, tls_verify: true, tls_hostname: nil, helo: &#39;localhost&#39;, user: nil, password: nil, authtype: DEFAULT_AUTH_TYPE) {|smtp| ... } -> object (8112.0)

新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。

...しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。


以下と同じです。

require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)

このメソッドにブロックを与え...
...ます。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。

Example:

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string, 'from@example.jp', 'to@example.jp'
}

@param address 接続...

Net::SMTP#capable_auth_types -> [String] (8106.0)

接続したサーバで利用可能な認証を配列で返します。

...接続したサーバで利用可能な認証を配列で返します。

返り値の配列の要素は、 'PLAIN', 'LOGIN', 'CRAM-MD5' です。

このメソッドは Net::SMTP#start などでセッションを開始
した以降にしか正しい値を返しません。...

Net::SMTP#open_message_stream(from_addr, *to_addrs) {|f| .... } -> () (8106.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

...主のメールアドレス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: fro...

Net::SMTP#ready(from_addr, *to_addrs) {|f| .... } -> () (8106.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

...主のメールアドレス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: fro...

絞り込み条件を変える

Net::SMTP#send_mail(mailsrc, from_addr, *to_addrs) -> () (8106.0)

メールを送信します。

...主のメールアドレス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',...
<< 1 2 3 ... > >>