5

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 derpviolin@gmail.com (20ms)
Date: Wed, 16 Feb 2011 23:09:54 -0800
From: derp.bot@gmail.com
To: derpviolin@gmail.com
Message-ID: <4d5cc9c2d6448_f88819dd6287289@dn0a203255.sunet.mail>
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.

Yuki Nishijima
  • 1,802
  • 2
  • 16
  • 19
Kyle
  • 607
  • 2
  • 6
  • 14
  • 2
    I think your username needs to be "username@gmail.com", rather than just the "username" part. – Ryan Bigg Feb 17 '11 at 07:39
  • 12
    it really says 'you suck' in your terminal? – E.E.33 Sep 02 '12 at 07:28
  • 1
    Possible duplicate of [Setting up a Gmail Account to work with ActionMailer in Rails 3](http://stackoverflow.com/questions/4929680/setting-up-a-gmail-account-to-work-with-actionmailer-in-rails-3) – BryanH Nov 11 '15 at 19:39

1 Answers1

3

See here for answer to similar problem.

Community
  • 1
  • 1
eugen
  • 8,916
  • 11
  • 57
  • 65