从Gmail Rails 3发送电子邮件

编程入门 行业动态 更新时间:2024-10-27 04:28:45
本文介绍了从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,:port => 587,:domain => 'derp':user_name => 'derp.bot',:password => 'derp42069',:authentication => 'plain',:enable_starttls_auto =>在终端中,我收到以下消息:$ b $

发送邮件至derpviolin@gmail(20ms)日期:2011年2月16日星期三23:09:54 -0800 自:derp.bot@gmail 要:derpviolin@gmail 邮件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", :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 (20ms) Date: Wed, 16 Feb 2011 23:09:54 -0800 From: derp.bot@gmail To: derpviolin@gmail 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发送电子邮件

本文发布于:2023-10-07 10:27:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469139.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发送电子邮件   Gmail   Rails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!