从 Gmail Rails 3 发送电子邮件

编程入门 行业动态 更新时间:2024-10-27 18:29:46
本文介绍了从 Gmail Rails 3 发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

发布评论

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

>www.elefans.com

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