Sending email from Gmail Rails 3

16,679

See here for answer to similar problem.

Share:
16,679
Kyle
Author by

Kyle

Updated on June 04, 2022

Comments

  • Kyle
    Kyle almost 2 years

    I'm trying to send an email through my gmail account. I copied the code directly from the rails guide, and in my terminal it's saying that it is sending the message however, the address I'm sending it to is not getting it. Here is the code I have in my env.rb file

    config.action_mailer.deconfig.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      :address              => "smtp.gmail.com",
      :port                 => 587,
      :domain               => 'derp'
      :user_name            => 'derp.bot',
      :password             => 'derp42069',
      :authentication       => 'plain',
      :enable_starttls_auto => true  }
    

    In the terminal, I'm getting the following message:

    Sent mail to [email protected] (20ms)
    Date: Wed, 16 Feb 2011 23:09:54 -0800
    From: [email protected]
    To: [email protected]
    Message-ID: <[email protected]>
    Subject: New Task
    Mime-Version: 1.0
    Content-Type: text/html;
     charset=UTF-8
    Content-Transfer-Encoding: 7bit
    
    you suck
    Rendered need_router/index.html.erb within layouts/application (2.1ms)
    Completed 200 OK in 371ms (Views: 8.3ms)
    

    However the email I'm sending it to is not receiving the message. Any help would be greatly appreciated.