且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Gmail Rails 3发送电子邮件

更新时间:2023-02-25 11:11:27

请参阅这里来解答类似的问题。


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.

See here for answer to similar problem.