From: Deepak Vohra Date: 2008-06-21T10:42:02+09:00 Subject: Re: Using actionmailer to send an email --0-226336747-1214012214=:42235 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Seems like the actionmailer has a bug. I tested the actionmailer and the em= ail does not get sent. =A0 thanks, Deepak --- On Fri, 6/20/08, APNelson.L wrote: From: APNelson.L Subject: Using actionmailer to send an email To: "ruby-talk ML" Date: Friday, June 20, 2008, 6:13 PM Hi, I was just wondering how i would write a ruby script to send an email using the gmail smtp. Here is what I have so far: require 'rubygems' require 'action_mailer' class SimpleMailer < ActionMailer::Base =09def simple_message(recipient) =09=09from 'my_email@gmail.com' =09=09recipients recipient =09=09subject 'yay I just sent this' =09=09body 'hope this works' =09end end ActionMailer::Base.smtp_settings =3D { :address =3D> 'smtp.gmail.com', :port =3D> '25', :user_name =3D> 'my_email@gmail.com', :password =3D> 'my_password', :authentication =3D> 'login' } SimpleMailer.deliver_simple_message('other_email@gmail.com') Unfortunately, when run I get these error messages: ruby mail.rb /usr/local/lib/ruby/1.8/net/smtp.rb:680:in `check_response': 530 5.7.0 Must issue a STARTTLS command first. z80sm1963933pyg.31 (Net::SMTPUnknownError) from /usr/local/lib/ruby/1.8/net/smtp.rb:582:in `auth_login' from /usr/local/lib/ruby/1.8/net/smtp.rb:686:in `critical' from /usr/local/lib/ruby/1.8/net/smtp.rb:581:in `auth_login' 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 /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/ action_mailer/base.rb:627:in `perform_delivery_smtp' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/ action_mailer/base.rb:508:in `__send__' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/ action_mailer/base.rb:508:in `deliver!' from /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/ action_mailer/base.rb:383:in `method_missing' from mail.rb:15 --0-226336747-1214012214=:42235--