class Net::SMTP
def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream
* IOError
* Net::ReadTimeout
* Net::SMTPUnknownError
* Net::SMTPFatalError
* Net::SMTPSyntaxError
* Net::SMTPServerBusy
This method may raise:
=== Errors
end
end
f.puts 'This is a test message.'
f.puts
f.puts 'Subject: test message'
f.puts 'To: dest@example.com'
f.puts 'From: from@example.com'
smtp.open_message_stream('from@example.com', ['dest@example.com']) do |f|
Net::SMTP.start('smtp.example.com', 25) do |smtp|
=== Example
the destination mail address or addresses.
+to_addr+ is a String or Net::SMTP::Address or Array of them, representing
+from_addr+ is a String or Net::SMTP::Address representing the source mail address.
=== Parameters
message with this method.
it is converted to the CR LF pair. You cannot send a binary
If a single CR ("\r") or LF ("\n") is found in the message,
<<(str):: outputs STR and returns self.
write(str):: outputs STR and returns the length of written bytes.
printf(fmt, *args):: outputs sprintf(fmt,*args).
print(str):: outputs STR.
puts(str = ''):: outputs STR and CR LF.
The stream is valid only in the block, and has these methods:
Opens a message writer stream and gives it to the block.
def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream raise IOError, 'closed session' unless @socket mailfrom from_addr rcptto_list(to_addrs) {data(&block)} end