ライブラリ
-
cgi
/ core (24) -
net
/ smtp (32) - openssl (12)
- psych (72)
-
webrick
/ httputils (12)
クラス
- CGI (24)
-
Net
:: SMTP (32) -
OpenSSL
:: PKCS7 (12) -
Psych
:: Nodes :: Scalar (48) -
WEBrick
:: HTTPUtils :: FormData (12)
キーワード
- Emitter (12)
- PLAIN (12)
- Parser (12)
- [] (12)
- header (12)
-
net
/ smtp (12) - out (12)
- plain= (12)
-
ruby 1
. 6 feature (12) - start (32)
-
webrick
/ cgi (12) -
write
_ smime (12)
検索結果
先頭5件
- Net
:: SMTP . start(address , port = Net :: SMTP . default _ port , helo = & # 39;localhost& # 39; , user = nil , password = nil , authtype = DEFAULT _ AUTH _ TYPE) -> Net :: SMTP - Net
:: SMTP . start(address , port = Net :: SMTP . default _ port , helo = & # 39;localhost& # 39; , user = nil , password = nil , authtype = DEFAULT _ AUTH _ TYPE) {|smtp| . . . . } -> object - 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 - 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 - CGI
# header(options = "text / html") -> String
-
Net
:: SMTP . start(address , port = Net :: SMTP . default _ port , helo = & # 39;localhost& # 39; , user = nil , password = nil , authtype = DEFAULT _ AUTH _ TYPE) -> Net :: SMTP (24.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
require 'net/smtp'
Net::SMTP.new(address, port).start(helo, user, password, authtype)
このメソッドにブロックを与えた場合には、新しく作られた Net::SMTP......えられた場合、
SMTP AUTH コマンドによって認証を行います。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。
Example:
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_......ドメイン名です
@param user 認証で使うアカウント名
@param password 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)
@raise TimeoutError 接続時にタイムアウトした場合に発生します
@raise Net::SMTPUnsupportedC......ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
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 (24.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
require 'net/smtp'
Net::SMTP.new(address, port).start(helo, user, password, authtype)
このメソッドにブロックを与えた場合には、新しく作られた Net::SMTP......えられた場合、
SMTP AUTH コマンドによって認証を行います。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。
Example:
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_......ドメイン名です
@param user 認証で使うアカウント名
@param password 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)
@raise TimeoutError 接続時にタイムアウトした場合に発生します
@raise Net::SMTPUnsupportedC......ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
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 (24.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)
このメソッドにブロックを与えた場合には、......えられた場合、
SMTP AUTH コマンドによって認証を行います。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。
Example:
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_......ドメイン名です
@param user 認証で使うアカウント名
@param password 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)
@raise TimeoutError 接続時にタイムアウトした場合に発生します
@raise Net::SMTPUnsupportedC... -
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 (24.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...ジェクトを生成し、サーバに接続し、セッションを開始します。
以下と同じです。
require 'net/smtp'
Net::SMTP.new(address, port).start(helo: helo, user: user, password: password, authtype: authtype)
このメソッドにブロックを与えた場合には、......えられた場合、
SMTP AUTH コマンドによって認証を行います。
authtype は使用する認証のタイプで、
シンボルで :plain, :login, :cram_md5 を指定します。
Example:
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_......ドメイン名です
@param user 認証で使うアカウント名
@param password 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)
@raise TimeoutError 接続時にタイムアウトした場合に発生します
@raise Net::SMTPUnsupportedC... -
CGI
# header(options = "text / html") -> String (18.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...成するための情報を指定します。
例:
header
# Content-Type: text/html
header("text/plain")
# Content-Type: text/plain
header({"nph" => true,
"status" => "OK", # == "200 OK"
# "status" =>......ookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})
例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "status" => "OK"})
print "<html><head><title>TITLE</title></head>\r\n"... -
CGI
# out(options = "text / html") { . . . . } (18.0) -
HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。
...指定します。
例:
cgi = CGI.new
cgi.out{ "string" }
# Content-Type: text/html
# Content-Length: 6
#
# string
cgi.out("text/plain"){ "string" }
# Content-Type: text/plain
# Content-Length: 6
#... -
OpenSSL
:: PKCS7 . write _ smime(p7sig , data=nil , flags = 0) -> String (18.0) -
PKCS7 オブジェクトから S/MIME 形式の文字列を返します。
...MIME ヘッダに text/plain を付加します。
これは OpenSSL::PKCS7.sign で
OpenSSL::PKCS7::DETACHED を渡した場合にのみ意味を持ちます。
例:
require 'openssl'
data = "foobar"
p7 = OpenSSL::PKCS7.sign( OpenSSL::X509::Certificate.new(File.read('cert.pem')......),
OpenSSL::PKey::RSA.new(File.read('privkey.pem')),
data)
smime = PKCS7.write_smime(p7)
@param p7sig PKCS#7 オブジェクト
@param data 署名されたデータ文字列
@param flags フラグ(整数値)
@raise OpenSSL::PKCS::PKCS7Error... -
net
/ smtp (18.0) -
メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol) を扱うライブラリです。
...、HELO ドメインには ISP のメール
サーバのドメインを使っておけばたいてい通ります。
=== SMTP認証
Net::SMTP は PLAIN, LOGIN, CRAM MD5 の3つの方法で認証をすることができます。
(認証については 2554, 2195 を参照してください)
認証......証する
必要がある場合は別の方法を考える必要があるでしょう。
require 'net/smtp'
# STARTTLSの例
smtp = Net::SMTP.new('smtp.example.com', 25)
# SSLのコンテキストを作成してSSLの設定をし、context に代入しておく
# TLSを常に使うよう......る
smtp.enable_starttls(context)
smtp.start() do
# send messages ...
end
TLS を使用したい場合は enable_tls を使用します。
require 'net/smtp'
# TLSの例
smtp = Net::SMTP.new('smtp.example.com', 465)
smtp.enable_tls
smtp.start do
# send messages ...
end......があるでしょう。
TLS を使用したい場合は enable_tls を使用します。
require 'net/smtp'
# TLSの例
smtp = Net::SMTP.new('smtp.example.com', 465)
smtp.enable_tls
smtp.start do
# send messages ...
end
サーバーが STARTTLS をサポートしている場合......くない場合は Net::SMTP#disable_starttls を使用します。
require 'net/smtp'
# STARTTLSを使用したくない例
smtp = Net::SMTP.new('smtp.example.com', 25)
smtp.disable_starttls
smtp.start do
# send messages ...
end
デフォルトではサーバー証明書の検証... -
WEBrick
:: HTTPUtils :: FormData # [](header) -> String | nil (12.0) -
自身が multipart/form-data なデータの場合に、header で指定された ヘッダの値を文字列で返します。無ければ nil を返します。
...nil を返します。
@param header ヘッダ名を文字列で指定します。大文字と小文字を区別しません。
例:
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q']['content-type'] #=> "plain/text"
end
end
MyCGI.new.start()...