るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.045秒)
トップページ > クエリ:-[x] > クエリ:send_message[x] > 種類:ライブラリ[x]

別のキーワード

  1. socket send
  2. udpsocket send
  3. socket msg_send
  4. object send
  5. _builtin send

検索結果

net/smtp (43.0)

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

...s block
}

smtp-server.example.com は適切な SMTP サーバのアドレスに読みかえてください。
通常は LAN の管理者やプロバイダが SMTP サーバを用意してくれているはずです。

セッションが開いたらあとは Net::SMTP#send_message
でメールを...
...tart('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: <unique.message.id.string@yourhost.exampl...
...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.start, Net::SMTP#start
を使うと fini...