On Jun 20, 2008, at 7:13 PM, APNelson.L wrote: > 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 > def simple_message(recipient) > from 'my_email / gmail.com' > recipients recipient > subject 'yay I just sent this' > body 'hope this works' > end > end > > ActionMailer::Base.smtp_settings = { :address => > 'smtp.gmail.com', :port => '25', :user_name => > 'my_email / gmail.com', :password => 'my_password', :authentication => > 'login' } > > SimpleMailer.deliver_simple_message('other_email / gmail.com') > you need to patch Net::SMTP to support tls, this is one of the easiest ways: http://drawohara.com/post/37908300/rails-using-ssl-tls-with-actionmailer-gmail cheers. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama