Sending Mail with SMTP : Email POP3 « Network « Ruby
- Ruby
- Network
- Email POP3
Sending Mail with SMTP
require 'net/smtp'
message = <<MESSAGE_END
From: Private Person <[email protected]>
To: Author of Beginning Ruby <[email protected]>
Subject: SMTP e-mail test
This is a test e-mail message.
MESSAGE_END
Net::SMTP.start('localhost') do |smtp|
smtp.send_message message, '[email protected]', '[email protected]'
end
Related examples in the same category