From: Dr Balwinder S Dheeman Date: 2005-05-14T18:45:29+09:00 Subject: Re: ruby smtp and gmail On 05/13/2005 06:30 AM, ruby talk wrote: > [code] > require 'net/smtp' > Net::SMTP.start('smtp.gmail.com', 25,'rubytalk@gmail.com' , > 'password' , :login ) do |smtp| ^^^^^^ You might need to enter 'login' here. I think Net::SMTP supports only 'login', 'plain' and, or 'cram_md5' methods for authentication, whereas 'cram_md5' is default and here in your attempt 'cram_md5' was selected 'cause :login was wrong. hence, 'tls' and, or 'starttls' is not available as yet. I'm working on Net:NNTP, after reading concerned RFC's I shall implement 'starttls' and, or other requisite methods too. The list of documents is long http://www.faqs.org/faqs/computer-security/ssl-talk-faq/index.html, so it may take time to implement all these functionalities. > smtp.open_message_stream('rubytalk@gmail.com', > ['rubytalk@gmail.com']) do |f| > f.puts 'From:rubytalk@gmail.com' > f.puts 'To:rubytalk@gmail.com' > f.puts 'Subject: test message' > f.puts > f.puts 'This is a test message.' > end > end > [/code] > > The error i get is > /usr/local/lib/ruby/1.8/net/smtp.rb:680:in `check_response': 530 5.7.0 > Must issue a STARTTLS command first (Net::SMTPUnknownError) The smtp.gmail.com supports only secure connections i.e TLS/SSL, that's why it is asking for a AUTH STARTTLS command. > from /usr/local/lib/ruby/1.8/net/smtp.rb:593:in `auth_cram_md5' > from /usr/local/lib/ruby/1.8/net/smtp.rb:592:in `critical' > from /usr/local/lib/ruby/1.8/net/smtp.rb:592:in `auth_cram_md5' > from /usr/local/lib/ruby/1.8/net/smtp.rb:571:in `__send__' > from /usr/local/lib/ruby/1.8/net/smtp.rb:571:in `authenticate' > from /usr/local/lib/ruby/1.8/net/smtp.rb:411:in `do_start' > from /usr/local/lib/ruby/1.8/net/smtp.rb:378:in `start' > from /usr/local/lib/ruby/1.8/net/smtp.rb:316:in `start' > from email.rb:2 > > any one find a fix for this or a work around? Am i doing it wrong? > will it work with other smtp servers? I only have gmail to work with. > BEcker I know, this information could only be of little use to you at this time and may not help you that much in resolving the isse at hend. Regards, -- Dr Balwinder Singh Dheeman Registered Linux User: #229709 CLLO (Chief Linux Learning Officer) Machines: #168573, 170593, 259192 Anu's Linux@HOME Distros: Ubuntu, Fedora, Knoppix More: http://anu.homelinux.net/~bsd/ Visit: http://counter.li.org/