るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.074秒)

別のキーワード

  1. smtp start
  2. net/smtp start
  3. smtp data
  4. net/smtp data

ライブラリ

クラス

検索結果

Net::SMTP#ready(from_addr, *to_addrs) {|f| .... } -> () (18168.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

.../smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp
.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}

ready
...
...生します
@raise Net::SMTPServerBusy SMTPエラーコード420,450の場合に発生します
@raise Net::SMTPSyntaxError SMTPエラーコード500の場合に発生します
@raise Net::SMTPFatalError SMTPエラーコード5xxの場合に発生します
@raise Net::SMTPAuthenticationError 送信...
...に必要な認証を行っていなかった場合に発生します
@raise Net::SMTPUnknownError SMTPエラーコードがプロトコル上不正な場合に発生します

@see Net::SMTP#send_message...

Net::SMTP#open_message_stream(from_addr, *to_addrs) {|f| .... } -> () (3068.0)

メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。

.../smtp'

Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp
.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}

ready
...
...生します
@raise Net::SMTPServerBusy SMTPエラーコード420,450の場合に発生します
@raise Net::SMTPSyntaxError SMTPエラーコード500の場合に発生します
@raise Net::SMTPFatalError SMTPエラーコード5xxの場合に発生します
@raise Net::SMTPAuthenticationError 送信...
...に必要な認証を行っていなかった場合に発生します
@raise Net::SMTPUnknownError SMTPエラーコードがプロトコル上不正な場合に発生します

@see Net::SMTP#send_message...