Forum: Ruby Plz check and tell me the error in this code

Posted by chandan mallik (chandan0707)
on 2013-02-20 15:31
require 'net/smtp'

message = <<MESSAGE_END
From: Private Person <me@fromdomain.com>
To: A Test User <chandan.k@cisinlabs.com>
MIME-Version: 1.0
Content-type: text/html
Subject: SMTP e-mail test

This is an e-mail message to be sent in HTML format

<b>This is HTML message.</b>
<h1>This is headline.</h1>
MESSAGE_END

Net::SMTP.start('localhost') do |smtp|
  smtp.send_message message, 'me@fromdomain.com',
                             'chandan.k@cisinlabs.com'
end
Posted by Joel Pearson (virtuoso)
on 2013-02-20 15:48
Please give the error message you receive.
I think the most likely reason for a failure would be that you don't 
have an SMTP server...
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.