data

data(msgstr = nil)
Instance Public methods

This method sends a message. If msgstr is given, sends it as a message. If block is given, yield a message writer stream. You must write message before the block is closed.

# Example 1 (by string)
smtp.data(<<EndMessage)
From: john@example.com
To: betty@example.com
Subject: I found a bug

Check vm.c:58879.
EndMessage

# Example 2 (by block)
smtp.data {|f|
  f.puts "From: john@example.com"
  f.puts "To: betty@example.com"
  f.puts "Subject: I found a bug"
  f.puts ""
  f.puts "Check vm.c:58879."
}
doc_ruby_on_rails
2015-04-22 13:30:13
Comments
Leave a Comment

Please login to continue.