Email.rb:11:in `<main>': uninitialized constant Net (NameError)

require ‘net/smtp’

message = <<MESSAGE_END
From: Private P. [email protected]
To: A Test User [email protected]
Subject: SMTP e-mail test

This is a test e-mail message.

Net::SMTP.start(‘localhost’) do |smtp|
smtp.send_message message, ‘[email protected]’,
[email protected]

It will pop up the error message : email.rb:11:in `’:
uninitialized constant Net (NameError)

How can I fix it?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs