I used the solution of Alexander Pomozhov to talk with Gmail from my Rails application. I believe the original article is gone, but someone played the Google cache here .
Library / smtp _tls.rb
require "openssl" require "net/smtp" Net::SMTP.class_eval do private def do_start(helodomain, user, secret, authtype) raise IOError, 'SMTP session already started' if @started check_auth_args user, secret, authtype if user or secret sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) } @socket = Net::InternetMessageIO.new(sock) @socket.read_timeout = 60
config /environment.rb
(add after everything else)
require "smtp_tls" ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :authentication => :plain, :user_name => " someone@openrain.com ", :password => 'someonesPassword' }
Use ActionMailer as usual.
ski
source share