send email using gmail as smtp

J

Junkone

hello
can i send email thro ruby using gmail as smtp. appreciate any help
here.
seede
 
J

Junkone

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



- 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
 
J

Junkone

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- 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 => "(e-mail address removed)",
: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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top