本文介绍了从 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 发送电子邮件
发布评论