るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. openssl name
  4. net/imap name
  5. win32ole name

検索結果

net/smtp (38084.0)

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

...す。
ブロックを使うと File.open と同じように終端処理を自動的にやってくれる
のでおすすめです。

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

smtp-server.example.com は適切な SMTP サ...
...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>
Subject: test m...
...require 'net/smtp'
# STARTTLSを使用したくない例
smtp = Net::SMTP.new('smtp.example.com', 25)
smtp.disable_starttls
smtp.start do
# send messages ...
end

デフォルトではサーバー証明書の検証を行い、正当な証明書でない場合は OpenSSL::SSL::SSLEr...