从Gmail Rails 3发送电子邮件 [英] Sending email from Gmail Rails 3

查看:117
本文介绍了从Gmail Rails 3发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试通过我的Gmail帐户发送电子邮件。我直接从rails guide复制了代码,而在我的终端中,它说它正在发送消息,但是我发送给它的地址没有得到它。这里是我在我的env.rb文件



  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 =>在终端中,我收到以下消息:$ b $






 发送邮件至derpviolin@gmail.com(20ms)
日期:2011年2月16日星期三23:09:54 -0800
自:derp.bot@gmail.com
要:derpviolin@gmail.com
邮件ID:其中4d5cc9c2d6448_f88819dd6287289@dn0a203255.sunet.mail>
主题:新任务
Mime-Version:1.0
Content-Type:text / html;
charset = UTF-8
Content-Transfer-Encoding:7bit

你吸
布局/应用程序中呈现的need_router / index.html.erb(2.1ms)
在371ms完成200 OK(查看:8.3ms)

然而,发送给它没有收到消息。任何帮助,将不胜感激。

解决方案

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


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.

这篇关于从Gmail Rails 3发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆