hello
can i send email thro ruby using gmail as smtp. appreciate any help
here.
seede
You can.
Here’s an article on using gmail with Rails, although you don’t need
to use Rails to use Action Mailer.
http://www.rubyinside.com/how-to-use-gmails-smtp-server-with-
rails-394.html
It’s dead simple.
Josh
On Dec 19, 9:19 pm, Joshua S. [email protected]
wrote:
Josh
- Show quoted text -
I followed all the steps. however i still dont knwo how to use it. all
the exampele i can find use the rails model methods. can you post a
example of how to send the email without using rails.
appreciate your help.
seede
On Dec 20, 5:17 pm, Junkone [email protected] wrote:
to use Rails to use Action Mailer.
hello
seede- Hide quoted text -
- Show quoted text -
here is what i tried,
require “smtp_tls”
require ‘action_mailer’
class Notifier < ActionMailer::Base
ActionMailer::Base.smtp_settings = {
:address => “smtp.gmail.com”,
:port => 587,
:authentication => :plain,
:user_name => “[email protected]”,
:password => “someonesPassword”
}
def Notifier.test_email(user_email)
subject “Free C1Alis”
from “system / example.com”
recipients user_email
body “Get large, #{user_email}!@”
end
end
Notifier.deliver_test_email(‘testuser / gmail.com’)
i get a error undefined method `test_email’ for #Notifier:0x5e2b1fc
but that is how it is defiened ever wehre. to do a
Class.deliver_methodname