別のキーワード
種類
- インスタンスメソッド (81)
- 特異メソッド (32)
- 文書 (17)
- ライブラリ (4)
クラス
- Array (21)
-
Net
:: SMTP (32) -
OpenSSL
:: SSL :: SSLContext (12) -
OpenSSL
:: SSL :: SSLSocket (12) - String (12)
-
URI
:: Generic (24)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) - host (12)
-
net
/ smtp (4) - pack (21)
- pack テンプレート文字列 (12)
-
servername
_ cb= (12) - start (32)
- unpack (12)
検索結果
先頭5件
- URI
:: Generic # hostname -> String | nil - OpenSSL
:: SSL :: SSLSocket # hostname -> String | nil - 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 - 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
-
URI
:: Generic # hostname -> String | nil (18224.0) -
自身の hostname を文字列で返します。また、URI::Generic#host が設 定されていない場合は nil を返します。
...自身の hostname を文字列で返します。また、URI::Generic#host が設
定されていない場合は nil を返します。
このメソッドは URI::Generic#host に IPv6 アドレスが設定されていた
場合はブラケットを削除した文字列を返しますがそれ以......外は同じ文字列を返し
ます。
require 'uri'
u = URI("http://[::1]/bar")
p u.hostname # => "::1"
p u.host # => "[::1]"... -
OpenSSL
:: SSL :: SSLSocket # hostname -> String | nil (18214.0) -
TLS の Server Name Indication 拡張で利用するサーバのホスト名を返します。
...TLS の Server Name Indication 拡張で利用するサーバのホスト名を返します。
OpenSSL::SSL::SSLSocket#hostname= で設定した値がそのまま返されます。
設定していない場合は nil を返します。
@see OpenSSL::SSL::SSLSocket#hostname=... -
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 (216.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...プで、
シンボルで :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 接続するサーバをホスト名もしくはIPアド......します
@param port ポート番号、デフォルトは 25 です
@param tls_verify サーバー証明書を検証するか否か
@param tls_hostname サーバー証明書のホスト名
@param helo HELO で名乗るドメイン名です
@param user 認証で使うアカウント名
@param passwo... -
Net
:: SMTP . start(address , port = Net :: SMTP . default _ port , helo = & # 39;localhost& # 39; , user = nil , password = nil , authtype = DEFAULT _ AUTH _ TYPE) {|smtp| . . . . } -> object (116.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...プで、
シンボルで :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 接続するサーバをホスト名もしくはIPアド......します
@param port ポート番号、デフォルトは 25 です
@param tls_verify サーバー証明書を検証するか否か
@param tls_hostname サーバー証明書のホスト名
@param helo HELO で名乗るドメイン名です
@param user 認証で使うアカウント名
@param passwo... -
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 (116.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...プで、
シンボルで :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 接続するサーバをホスト名もしくはIPアド......します
@param port ポート番号、デフォルトは 25 です
@param tls_verify サーバー証明書を検証するか否か
@param tls_hostname サーバー証明書のホスト名
@param helo HELO で名乗るドメイン名です
@param user 認証で使うアカウント名
@param passwo... -
Net
:: SMTP . start(address , port = Net :: SMTP . default _ port , helo = & # 39;localhost& # 39; , user = nil , password = nil , authtype = DEFAULT _ AUTH _ TYPE) {|smtp| . . . . } -> object (113.0) -
新しい SMTP オブジェクトを生成し、サーバに接続し、セッションを開始します。
...プで、
シンボルで :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 接続するサーバをホスト名もしくはIPアド......します
@param port ポート番号、デフォルトは 25 です
@param tls_verify サーバー証明書を検証するか否か
@param tls_hostname サーバー証明書のホスト名
@param helo HELO で名乗るドメイン名です
@param user 認証で使うアカウント名
@param passwo... -
URI
:: Generic # host -> String | nil (107.0) -
自身の host を文字列で返します。設定されていない場合は nil を返します。
...自身の host を文字列で返します。設定されていない場合は nil を返します。
@see URI::Generic#hostname... -
net
/ smtp (66.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 サーバのアドレスに読みかえてください。......らあとは Net::SMTP#send_message
でメールを流しこむだけです。
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>......ify: false) do |smtp|
# send messages ...
end
サーバー証明書に引数で指定したホスト名が含まれていなければ OpenSSL::SSL::SSLError 例外が発生します。
証明書に含まれない名前(IPアドレス等)で接続したい場合は、+tls_hostname+ で証明... -
Array
# pack(template) -> String (48.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...by"
[82, 117, 98, 121].pack("c*") # => "Ruby"
s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変......換する例
//emlist[][ruby]{
"Ruby".unpack('C*') # => [82, 117, 98, 121]
a = []
"Ruby".each_byte {|c| a << c}
a # => [82, 117, 98, 121]
//}
: "x" でヌルバイトを埋めることができる
//emlist[][ruby]{
[82, 117, 98, 121].pack("ccxxcc") # => "Ru\x00\x00by"
//}
: "x" で文字......mlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x0... -
Array
# pack(template , buffer: String . new) -> String (48.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...by"
[82, 117, 98, 121].pack("c*") # => "Ruby"
s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変......換する例
//emlist[][ruby]{
"Ruby".unpack('C*') # => [82, 117, 98, 121]
a = []
"Ruby".each_byte {|c| a << c}
a # => [82, 117, 98, 121]
//}
: "x" でヌルバイトを埋めることができる
//emlist[][ruby]{
[82, 117, 98, 121].pack("ccxxcc") # => "Ru\x00\x00by"
//}
: "x" で文字......mlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x0... -
String
# unpack(template) -> Array (48.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...by"
[82, 117, 98, 121].pack("c*") # => "Ruby"
s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変......換する例
//emlist[][ruby]{
"Ruby".unpack('C*') # => [82, 117, 98, 121]
a = []
"Ruby".each_byte {|c| a << c}
a # => [82, 117, 98, 121]
//}
: "x" でヌルバイトを埋めることができる
//emlist[][ruby]{
[82, 117, 98, 121].pack("ccxxcc") # => "Ru\x00\x00by"
//}
: "x" で文字......mlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x0... -
pack テンプレート文字列 (48.0)
-
pack テンプレート文字列
...by"
[82, 117, 98, 121].pack("c*") # => "Ruby"
s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変......換する例
//emlist[][ruby]{
"Ruby".unpack('C*') # => [82, 117, 98, 121]
a = []
"Ruby".each_byte {|c| a << c}
a # => [82, 117, 98, 121]
//}
: "x" でヌルバイトを埋めることができる
//emlist[][ruby]{
[82, 117, 98, 121].pack("ccxxcc") # => "Ru\x00\x00by"
//}
: "x" で文字......mlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x0...