so here is the code:
require 'net/smtp'
message = <<MESSAGE_END
From: XXX <xxxx@gmail.com>
To: XXXXX <xxxx@gmail.com>
Subject: Test
This is a test e-mail message.
MESSAGE_END
begin
Net::SMTP.new 'smtp.gmail.com', 587
Net::SMTP.enable_starttls
Net::SMTP.start('gmail.com','xxxx@gmail.com', 'xxx') do |smtp|
smtp.send_message message, 'xxxx@gmail.com',
'xxxxxx@gmail.com'
end
rescue Exception => e
print "Exception occured: " + e.to_s
end
The error:
Exception occured: undefined method `enable_starttls' for Net::SMTP:Class
I found solution over the web it is about installing some additional gem but I cannot make it work.
Is there any other way to make it work?
I`m using Netbeans 7.0 as "compiler".

New Topic/Question
Reply



MultiQuote






|