class Net::SMTP
def send_message(msgstr, from_addr, *to_addrs)
* IOError
* Net::ReadTimeout
* Net::SMTPUnknownError
* Net::SMTPFatalError
* Net::SMTPSyntaxError
* Net::SMTPServerBusy
This method may raise:
=== Errors
end
Net::SMTP::Address.new('dest@example.com', notify: :success)
Net::SMTP::Address.new('from@example.com', size: 12345),
smtp.send_message msgstr,
Net::SMTP.start('smtp.example.com') do |smtp|
end
['dest@example.com', 'dest2@example.com']
'from@example.com',
smtp.send_message msgstr,
Net::SMTP.start('smtp.example.com') 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.
the message headers and body.
binary message with this method. +msgstr+ should include both
in the +msgstr+, are converted into the CR LF pair. You cannot send a
Sends +msgstr+ as a message. Single CR ("\r") and LF ("\n") found
def send_message(msgstr, from_addr, *to_addrs) raise IOError, 'closed session' unless @socket mailfrom from_addr rcptto_list(to_addrs) {data msgstr} end