るりまサーチ

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

別のキーワード

  1. _builtin disable
  2. socket iff_disable_netpoll
  3. pop disable_ssl
  4. pop3 disable_ssl
  5. net/pop disable_ssl

検索結果

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 サ...
...TP#finish を呼んで
セッションを終了しなければいけません。
File のように GC 時に勝手に close されることもありません。

# using SMTP#finish
require 'net/smtp'
smtp = Net::SMTP.start('smtp.example.com', 25)
smtp.send_message mail_string, 'from@example...
...ているのに 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

デフォル...