tags:

views:

53

answers:

1

Hi, i´m trying to send an email from ruby but I get an error msg. I have this code:

    require 'net/smtp'

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

This is a test e-mail message.
MESSAGE_END

Net::SMTP.start('smtp.test.net', 25,   'test.com',  'usr', 'pwd', :login) do |smtp| 

  smtp.send_message message, '[email protected]',     '[email protected]'
end

Error msg is: C:/Archivos de programa/BitNami Redmine Stack/ruby/lib/ruby/1.8/net/smtp.rb:948: in check_auth_continue': 502 unimplemented (#5.5.1) (Net::SMTPSyntaxError) from C:/Archivos de programa/BitNami Redmine Stack/ruby/lib/ruby/1.8/net /smtp.rb:740:inauth_login' from C:/Archivos de programa/BitNami Redmine Stack/ruby/lib/ruby/1.8/net /smtp.rb:921:in `critical'

Thanks

+1  A: 

Unless you absolutely need to manually talk SMTP, I'd use either ActionMailer (from Rails), or maybe Pony. They provide really simple interfaces and deal with the STMP for you.

dunedain289