send email using gmail as smtp

Discussion in 'Ruby' started by Junkone, Dec 20, 2007.

  1. Junkone

    Junkone Guest

    hello
    can i send email thro ruby using gmail as smtp. appreciate any help
    here.
    seede
     
    Junkone, Dec 20, 2007
    #1
    1. Advertising

  2. 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, 2007, at 9:10 PM, Junkone wrote:

    > hello
    > can i send email thro ruby using gmail as smtp. appreciate any help
    > here.
    > seede
    >
     
    Joshua Schairbaum, Dec 20, 2007
    #2
    1. Advertising

  3. Junkone

    Junkone Guest

    On Dec 19, 9:19 pm, Joshua Schairbaum <>
    wrote:
    > 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, 2007, at 9:10 PM, Junkone wrote:
    >
    >
    >
    > > hello
    > > can i send email thro ruby using gmail as smtp. appreciate any help
    > > here.
    > > seede- Hide quoted text -

    >
    > - 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
     
    Junkone, Dec 20, 2007
    #3
  4. Junkone

    Junkone Guest

    On Dec 20, 5:17 pm, Junkone <> wrote:
    > On Dec 19, 9:19 pm, Joshua Schairbaum <>
    > wrote:
    >
    >
    >
    >
    >
    > > 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, 2007, at 9:10 PM, Junkone wrote:

    >
    > > > hello
    > > > can i send email thro ruby using gmail as smtp. appreciate any help
    > > > here.
    > > > seede- Hide quoted text -

    >
    > > - 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- 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 => "",
    :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
     
    Junkone, Dec 20, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    15
    Views:
    156,222
    abhishek-technicalwork
    Jul 11, 2012
  2. Gabriel Genellina

    Re: smtplib send email by using gmail smtp server

    Gabriel Genellina, May 3, 2009, in forum: Python
    Replies:
    0
    Views:
    467
    Gabriel Genellina
    May 3, 2009
  3. online
    Replies:
    0
    Views:
    914
    online
    Sep 6, 2009
  4. Brian Rhiel
    Replies:
    1
    Views:
    193
    Hassan Schroeder
    May 31, 2010
  5. ashish makani
    Replies:
    5
    Views:
    646
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page