Sending email from Gmail Rails 3

 ̄綄美尐妖づ 提交于 2019-11-28 01:10:22

问题


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.


回答1:


See here for answer to similar problem.



来源:https://stackoverflow.com/questions/5026098/sending-email-from-gmail-rails-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!