Heroku不使用Gmail SMTP发送电子邮件 [英] Heroku not sending email with Gmail SMTP

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

问题描述

该应用程序可以工作,我试图在设计中使用Confirmable,在我的Rails应用程序中,它表示电子邮件已发送,但我从未收到它。我通过SMTP配置它。



谢谢。



Heroku日志:

  2016-03-27T04:49:23.448947 + 00:00 app [web.1]:Rendered devise / shared / _links.html.erb (1.0ms)
2016-03-27T04:49:23.449047 + 00:00 app [web.1]:渲染布局/应用程序中的设计/会议/ new.html.erb(9.4ms)
2016-03-27T04:49:23.450618 + 00:00 app [web.1]:渲染布局/ _navbar.html.erb(0.5ms)
2016-03-27T04:49:23.451085 + 00:00 app [web.1]:呈现的布局/ _footer.html.erb(0.1ms)
2016-03-27T04:49:23.451438 + 00:00 app [web.1]:在14ms内完成200 OK host = my-task-in-method = GET_path =/ favicon.icohost = my-task- tracker.herokuapp.com request_id = 146e1632-c484-471f-97c3-feaaf1a1b2ed fwd =108.219.46.125dyno = web.1 connect = 3ms service = 11ms status = 304 bytes = 133
2016-03-27T04: 49:29.128082 + 00:00 heroku [router]:at = info method = GET path =/ users / confirma新/主机= my-task-tracker.herokuapp.com request_id = 1b9d8a7c-7c9e-4e50-a4f0-4be476c92dfb fwd =108.219.46.125dyno = web.1 connect = 1ms service = 33ms status = 200 bytes = 3182
2016-03-27T04:49:29.132299 + 00:00 app [web.1]:开始GET/ users / confirmation / new为108.219.46.125于2016-03-27 04:49:29 + 0000
2016-03-27T04:49:29.137153 + 00:00 app [web.1]:通过Devise :: ConfirmationsController#new处理HTML
2016-03-27T04:49:29.151819 + 00 :00 app [web.1]:渲染设计/共享/ _links.html.erb(1.4ms)
2016-03-27T04:49:29.151898 + 00:00 app [web.1]:渲染设计/ (6.7ms)
2016-03-27T04:49:29.153383 + 00:00 app [web.1]:呈现的布局/ _navbar.html.erb(0.5ms )
2016-03-27T04:49:29.153706 + 00:00 app [web.1]:渲染布局/ _footer.html.erb(0.1ms)
2016-03-27T04:49:29.154027 +00:00 app [web.1]:在17ms内完成200 OK(查看:15.5ms | ActiveRecord:0.0ms)
2016-03-27T04:49:29.386263 + 00:00 heroku [router]:at = info method = GET path =/ favicon.icohost = my-task-tracker.herokuapp .com request_id = c0dbab1b-9032-4787-bb64-3070feb0066b fwd =108.219.46.125dyno = web.1 connect = 1ms service = 7ms status = 304 bytes = 133
2016-03-27T04:49:32.066230 +00:00 app [web.1]:开始POST/ users / confirmation为108.219.46.125于2016-03-27 04:49:32 +0000
2016-03-27T04:49:32.068692+ 00:00 app [web.1]:通过Devise :: ConfirmationsController处理#以HTML格式创建
2016-03-27T04:49:32.068831 + 00:00 app [web.1]:参数:{utf8 =>,authenticity_token=>HnARWykNdBAKSmewO6izaOQ4Vokg9V46SxzCUADvtybFpbVVfuErGn / QLRQXWc4j79Krq9sAfBveAjR1ar9C7g ==,user=> {email=>smith.hampton23@gmail.com},commit=> ;重新发送确认说明}
2016-03-27T04:49:32.082510 + 00:00 app [web.1]:用户负载(1.0ms)SELECTusers。* FROMusersWHEREusers 。unconfirmed_email= $ 1 ORDER BYusers。idASC LIMIT 1 [[ unconfirmed_email,smith.hampton23@gmail.com]]
2016-03-27T04:49:32.091027 + 00:00 app [web.1]:用户载入(3.1ms)SELECTusers。 * FROMusersWHEREusers。email= $ 1 ORDER BYusers。idASC LIMIT 1 [[email,smith.hampton23@gmail.com]]
2016- 03-27T04:49:32.103821 + 00:00 app [web.1]:(12.0ms)BEGIN
2016-03-27T04:49:32.126821 + 00:00 app [web.1]:(20.9ms )COMMIT
2016-03-27T04:49:32.227009 + 00:00 app [web.1]:渲染设计/邮件/ confirmation_instructions.html.erb(8.6ms)
2016-03-27T04: 49:32.973627 + 00:00 app [web.1]:
2016-03-27T04:49:32.973641 + 00:00 app [web.1]:Devise :: Mailer#confirmation_instructions:在843.7处理出站邮件ms
2016-03-27T04:49:33.194388 + 00:00 app [web.1]:
2016-03-27T04:49:33.194402 + 00:00 app [web.1]:Sent mail至smith.hampton23@gmail.com(220.6ms)
2016-03-27T04:49:33.194407 + 00:00 app [web.1]:日期:2016年3月27日星期日04:49:32 + 0000
2016-03-27T04:49:33.194408 + 00:00 app [web.1]:From:smith.hampton2 3@gmail.com
2016-03-27T04:49:33.194409 + 00:00 app [web.1]:回复:smith.hampton23@gmail.com
2016-03-27T04: 49:33.194410 + 00:00 app [web.1]:收件人:smith.hampton23@gmail.com
2016-03-27T04:49:33.194413 + 00:00 app [web.1]:Message-ID :< 56f7665cef03b_33febb8de74141bf@29f38684-21c7-41d6-821e-42ae72d533ac.mail>
2016-03-27T04:49:33.194414 + 00:00 app [web.1]:主题:确认说明
2016-03-27T04:49:33.194415 + 00:00 app [web.1 ]:Mime-Version:1.0
2016-03-27T04:49:33.194415 + 00:00 app [web.1]:Content-Type:text / html;
2016-03-27T04:49:33.194416 + 00:00 app [web.1]:charset = UTF-8
2016-03-27T04:49:33.194417 + 00:00 app [web。 1]:Content-Transfer-Encoding:7bit
2016-03-27T04:49:33.194418 + 00:00 app [web.1]:< p>欢迎smith.hampton23@gmail.com!< p为H.
2016-03-27T04:49:33.194417 + 00:00 app [web.1]:
2016-03-27T04:49:33.194419 + 00:00 app [web.1]:
2016-03-27T04:49:33.194420 + 00:00 app [web.1]:< p>您可以通过以下链接确认您的帐户电子邮件地址:< / p>
2016-03-27T04:49:33.194421 + 00:00 app [web.1]:
2016-03-27T04:49:33.194423 + 00:00 app [web.1]:< p>< a href =https://my-task-tracker.herokuapp.com/users/confirmation?confirmation_token=yBnGnJEZkkaL-pU7_Y_U&amp;locale=en>确认我的帐户< / a>< / p为H.
2016-03-27T04:49:33.194424 + 00:00 app [web.1]:
2016-03-27T04:49:33.201842 + 00:00 app [web.1]:重定向到https://my-task-tracker.herokuapp.com/users/sign_in
2016-03-27T04:49:33.202005 + 00:00 app [web.1]:Completed 302 Found in 1133ms(ActiveRecord:37.8 ms)
2016-03-27T04:49:33.187258 + 00:00 heroku [router]:at = info method = POST path =/ users / confirmationhost = my-task-tracker.herokuapp.com request_id = 3fa250b9-23e4-43f7-8e10-4f37e54d9a79 fwd =108.219.46.125dyno = web.1 connect = 1ms service = 1162ms status = 302 bytes = 1245
2016-03-27T04:49:33.361655 + 00: 00 app [web.1]:在2016-03-27 04:49:33 +0000
开始GET/ users / sign_in为108.219.46.125 2016-03-27T04:49:33.372833 + 00:00 app [web.1]:通过Devise :: SessionsController处理#new as HTML
2016-03-27T04:49:33.400388 + 00:00 app [web.1]:渲染设计/共享/ _links.html。 erb(1.3ms)
2016-03-27T04:49:33.400564 + 00:00 app [web.1]:在布局/应用程序中呈现设计/会议/ new.html.erb(24.7ms)
2016- 03-27T04:49:33.402011 + 00:00 app [web.1]:渲染布局/ _navbar.html.erb(0.6ms)
2016-03-27T04:49:33.402772 + 00:00 app [web .1b]:渲染布局/ _footer.html.erb(0.1ms)
2016-03-27T04:49:33.403290 + 00:00 app [web.1]:在30ms内完成200 OK(查看:28.3ms | ActiveRecord:0.0ms)
2016-03-27T04:49:33.376910 + 00:00 heroku [router]:at = info method = GET path =/ users / sign_inhost = my-task-tracker.herokuapp .com request_id = 72189b98-69bc-415f-ade7-a21856684a0a fwd =108.219.46.125dyno = web.1 connect = 5ms service = 47ms status = 200 bytes = 4220
2016-03-27T05:23:51.692897 +00:00 heroku [web.1]:怠速
2016-03-27T05:23:51.693798 + 00:00 heroku [web.1]:状态由上升至下降
2016-03- 27T05:23:57.760741 + 00:00 heroku [web.1]:使用SIGTERM
停止所有进程2016-03-27T05:23:59.284360 + 00:00 app [web.1]:/ app / vendor / ruby-2.2.4 / lib / ruby​​ / 2.2.0 / webrick / server.rb:174:在`select'
2016-03-27T05:23:59.284343 + 00:00 app [web.1]: [2016-03-27 05:23:59] FATAL SignalException:SIGTERM
2016-03-27T05:23:59.284363 + 00:00 app [web.1]:/app/vendor/ruby-2.2.4 /lib/ruby/2.2.0/webrick/server.rb:174:in`block in start'
2016-03-27T05:23:59.284364 + 00:00 app [web.1]:/ app / vendor / ruby​​-2.2.4 / lib / ruby​​ / 2.2.0 / webrick / server.rb:32:在`start'
2016-03-27T05:23:59.284365 + 00:00 app [web.1]:/app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:162 :在`开始'
2016-03-27T05:23:59.284365 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/ lib / rack / handler / webrick.rb:34:在`run'
2016-03-27T05:23:59.284367 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2 .0 / gems / railties-4.2.4 / lib / rails / commands / server.rb:80:在`start'
2016-03-27T05:23:59.284366 + 00:00 app [web.1] :/app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in`start'
2016-03-27T05:23:59.284367+ 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in`block in server'
2016-03-27T05:23:59.284368 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/ commands_tasks.rb:75:在'tap'
2016-03-27T05:23:59.284369 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/railties -4.2.4 / LIB /轨道/命令/命令_tasks.rb:39:在`run_command!'
2016-03-27T05:23:59.284369 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.2.0/gems/ railties-4.2.4 / lib / rails / commands / commands_tasks.rb:75:在`server'
2016-03-27T05:23:59.284370 + 00:00 app [web.1]:/ app / vendor /bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in`< top(required)>'
2016-03-27T05:23:应用[web.1]:bin / rails:9:在'require'
2016-03-27T05:23:59.284391 + 00:00 app [web.1]:bin / rails: 9:在< main>'
2016-03-27T05:23:59.284464 + 00:00 app [web.1]:[2016-03-27 05:23:59] INFO正在关机。 ..
2016-03-27T05:23:59.284516 + 00:00 app [web.1]:[2016-03-27 05:23:59] INFO WEBrick :: HTTPServer#开始完成。
2016-03-27T05:23:59.284544 + 00:00 app [web.1]:退出
2016-03-27T05:24:00.235601 + 00:00 heroku [web.1]:过程退出状态143
2016-03-27T05:29:00.462487 + 00:00 heroku [web.1]:Unidling
2016-03-27T05:29:00.462791 + 00:00 heroku [web。 1]:状态从下变为开始
2016-03-27T05:29:03.166146 + 00:00 heroku [web.1]:使用命令`bin / rails server -p 18537 -e production` $启动进程b $ b 2016-03-27T05:29:06.739510 + 00:00 app [web.1]:[2016-03-27 05:29:06] INFO WEBrick 1.3.1
2016-03-27T05: 29:06.739563 + 00:00 app [web.1]:[2016-03-27 05:29:06] INFO ruby​​ 2.2.4(2015-12-16)[x86_64-linux]
2016-03 -27T05:29:06.739784 + 00:00 app [web.1]:[2016-03-27 05:29:06] INFO WEBrick :: HTTPServer#start:pid = 3 port = 18537
2016-03 -27T05:29:07.331731 + 00:00 heroku [web.1]:状态从开始改为
2016-03-27T05:29:08.588190 + 00:00 heroku [router]:at = info method = GET path =/host = my-task-tracker.herokuapp.com request_id = 4343eecf-3333-496c-936d-9881c5d12412 fwd =108.219.46.125dyno = web.1 connect = 0ms service = 92ms status = 302 bytes = 1122
2016-03-27T05:29:08.517272 + 00:00 app [web.1]:=> ;启动WEBrick
2016-03-27T05:29:08.517309 + 00:00 app [web.1]:=> Rails 4.2.4应用程序开始生产http://0.0.0.0:18537
2016-03-27T05:29:08.517311 + 00:00 app [web.1]:=>为更多启动选项运行`rails server -h`
2016-03-27T05:29:08.517312 + 00:00 app [web.1]:=> Ctrl-C关闭服务器
2016-03-27T05:29:08.517313 + 00:00 app [web.1]:开始GET/为108.219.46.125于2016-03-27 05:29:08 +0000
2016-03-27T05:29:08.555988 + 00:00 app [web.1]:通过PagesController#index处理HTML
2016-03-27T05:29:08.565676 + 00:00在[url = http://blog.csdn.net/jp/article/article/details/175805] [web.1]:已完成401未授权10ms(ActiveRecord:0.0ms)
2016-03-27T05:29:08.953091 + 00:00 heroku [router]:at = info method = GET path =/ users / sign_inhost = my-task-tracker.herokuapp.com request_id = 69e03185-2d8f-41c5-ba23-d62fe66fdf6e fwd =108.219.46.125dyno = web.1 connect = 0ms service = 57ms status = 200 bytes = 4002
2016-03-27T05:29:08.917010 + 00:00 app [web.1]:开始GET/ users / sign_in为108.219.46.125于2016-03-27 05:29:08 +0000
2016-03-27T05:29:08.919553 + 00:00 app [web.1]:由Devise :: SessionsController处理#new as HTML
2016-03-27T05:29:08.961087 + 00:00 app [web.1]:渲染设计/共享/ _links.html.erb(2.9ms)
2016-03-27T05:29:08.961219 + 00:00 app [web.1]:Rendered devise / sessi (10.0ms)
2016-03-27T05:29:08.964675 + 00:00 app [web.1]:渲染布局/ _navbar.html.erb(1.4ms )
2016-03-27T05:29:08.965909 + 00:00 app [web.1]:渲染布局/ _footer.html.erb(0.3ms)
2016-03-27T05:29:08.966140 +00:00 app [web.1]:在47ms内完成200行(视图:18.3ms | ActiveRecord:5.9ms)
2016-03-27T05:29:09.845722 + 00:00 heroku [router]:at = info method = GET path =/ favicon.icohost = my-task-tracker.herokuapp .com request_id = 5893b11b-579b-4937-9dc7-1b4b63c7ea3f fwd =108.219.46.125dyno = web.1 connect = 0ms service = 4ms status = 304 bytes = 133
pre>

env / production.rb

  config.action_mailer.default_url_options = {:host => 'https:// my-task-tracker.herokuapp.com'} 
config.action_mailer.delivery_method =:smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default:charset => utf-8
config.action_mailer.smtp_settings = {
:address => smtp.gmail.com,
:port => 587,
:user_name => ENV [GMAIL_USERNAME],
:password => ENV [GMAIL_PASSWORD],
:authentication => plain,
:enable_starttls_auto => true

$ / code>


解决方案

您想通过Gmail发送电子邮件的重要事情smtp:


  1. 您的应用程序配置:




    • 主机: smtp.gmail.com

    • 端口: 587 465 (587代表tls,465代表ssl)

    • 协议: tls ssl

    • 用户: YOUR_USERNAME@gmail.com

    • 密码: YOUR_PASSWORD


  2. 给定的Gmail帐户设置:





The app works everything, I'm trying to use Confirmable with Devise, on my Rails app it says that the email was sent, but I never receive it. I'm configuring it with Gmail though SMTP.

Thanks.

the Heroku log:

2016-03-27T04:49:23.448947+00:00 app[web.1]:   Rendered devise/shared/_links.html.erb (1.0ms)
2016-03-27T04:49:23.449047+00:00 app[web.1]:   Rendered devise/sessions/new.html.erb within layouts/application (9.4ms)
2016-03-27T04:49:23.450618+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (0.5ms)
2016-03-27T04:49:23.451085+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.1ms)
2016-03-27T04:49:23.451438+00:00 app[web.1]: Completed 200 OK in 14ms (Views: 12.2ms | ActiveRecord: 0.0ms)
2016-03-27T04:49:23.949248+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=my-task-tracker.herokuapp.com request_id=146e1632-c484-471f-97c3-feaaf1a1b2ed fwd="108.219.46.125" dyno=web.1 connect=3ms service=11ms status=304 bytes=133
2016-03-27T04:49:29.128082+00:00 heroku[router]: at=info method=GET path="/users/confirmation/new" host=my-task-tracker.herokuapp.com request_id=1b9d8a7c-7c9e-4e50-a4f0-4be476c92dfb fwd="108.219.46.125" dyno=web.1 connect=1ms service=33ms status=200 bytes=3182
2016-03-27T04:49:29.132299+00:00 app[web.1]: Started GET "/users/confirmation/new" for 108.219.46.125 at 2016-03-27 04:49:29 +0000
2016-03-27T04:49:29.137153+00:00 app[web.1]: Processing by Devise::ConfirmationsController#new as HTML
2016-03-27T04:49:29.151819+00:00 app[web.1]:   Rendered devise/shared/_links.html.erb (1.4ms)
2016-03-27T04:49:29.151898+00:00 app[web.1]:   Rendered devise/confirmations/new.html.erb within layouts/application (6.7ms)
2016-03-27T04:49:29.153383+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (0.5ms)
2016-03-27T04:49:29.153706+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.1ms)
2016-03-27T04:49:29.154027+00:00 app[web.1]: Completed 200 OK in 17ms (Views: 15.5ms | ActiveRecord: 0.0ms)
2016-03-27T04:49:29.386263+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=my-task-tracker.herokuapp.com request_id=c0dbab1b-9032-4787-bb64-3070feb0066b fwd="108.219.46.125" dyno=web.1 connect=1ms service=7ms status=304 bytes=133
2016-03-27T04:49:32.066230+00:00 app[web.1]: Started POST "/users/confirmation" for 108.219.46.125 at 2016-03-27 04:49:32 +0000
2016-03-27T04:49:32.068692+00:00 app[web.1]: Processing by Devise::ConfirmationsController#create as HTML
2016-03-27T04:49:32.068831+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"HnARWykNdBAKSmewO6IZaOQ4Vokg9V46SxzCUADvtybFpbVVfuErGn/QLRQXWc4j79Krq9sAfBveAjR1ar9C7g==", "user"=>{"email"=>"smith.hampton23@gmail.com"}, "commit"=>"Resend confirmation instructions"}
2016-03-27T04:49:32.082510+00:00 app[web.1]:   User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."unconfirmed_email" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["unconfirmed_email", "smith.hampton23@gmail.com"]]
2016-03-27T04:49:32.091027+00:00 app[web.1]:   User Load (3.1ms)  SELECT  "users".* FROM "users" WHERE "users"."email" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["email", "smith.hampton23@gmail.com"]]
2016-03-27T04:49:32.103821+00:00 app[web.1]:    (12.0ms)  BEGIN
2016-03-27T04:49:32.126821+00:00 app[web.1]:    (20.9ms)  COMMIT
2016-03-27T04:49:32.227009+00:00 app[web.1]:   Rendered devise/mailer/confirmation_instructions.html.erb (8.6ms)
2016-03-27T04:49:32.973627+00:00 app[web.1]: 
2016-03-27T04:49:32.973641+00:00 app[web.1]: Devise::Mailer#confirmation_instructions: processed outbound mail in 843.7ms
2016-03-27T04:49:33.194388+00:00 app[web.1]: 
2016-03-27T04:49:33.194402+00:00 app[web.1]: Sent mail to smith.hampton23@gmail.com (220.6ms)
2016-03-27T04:49:33.194407+00:00 app[web.1]: Date: Sun, 27 Mar 2016 04:49:32 +0000
2016-03-27T04:49:33.194408+00:00 app[web.1]: From: smith.hampton23@gmail.com
2016-03-27T04:49:33.194409+00:00 app[web.1]: Reply-To: smith.hampton23@gmail.com
2016-03-27T04:49:33.194410+00:00 app[web.1]: To: smith.hampton23@gmail.com
2016-03-27T04:49:33.194413+00:00 app[web.1]: Message-ID: <56f7665cef03b_33febb8de74141bf@29f38684-21c7-41d6-821e-42ae72d533ac.mail>
2016-03-27T04:49:33.194414+00:00 app[web.1]: Subject: Confirmation instructions
2016-03-27T04:49:33.194415+00:00 app[web.1]: Mime-Version: 1.0
2016-03-27T04:49:33.194415+00:00 app[web.1]: Content-Type: text/html;
2016-03-27T04:49:33.194416+00:00 app[web.1]:  charset=UTF-8
2016-03-27T04:49:33.194417+00:00 app[web.1]: Content-Transfer-Encoding: 7bit
2016-03-27T04:49:33.194418+00:00 app[web.1]: <p>Welcome smith.hampton23@gmail.com!</p>
2016-03-27T04:49:33.194417+00:00 app[web.1]: 
2016-03-27T04:49:33.194419+00:00 app[web.1]: 
2016-03-27T04:49:33.194420+00:00 app[web.1]: <p>You can confirm your account email through the link below:</p>
2016-03-27T04:49:33.194421+00:00 app[web.1]: 
2016-03-27T04:49:33.194423+00:00 app[web.1]: <p><a href="https://my-task-tracker.herokuapp.com/users/confirmation?confirmation_token=yBnGnJEZkkaL-pU7_Y_U&amp;locale=en">Confirm my account</a></p>
2016-03-27T04:49:33.194424+00:00 app[web.1]: 
2016-03-27T04:49:33.201842+00:00 app[web.1]: Redirected to https://my-task-tracker.herokuapp.com/users/sign_in
2016-03-27T04:49:33.202005+00:00 app[web.1]: Completed 302 Found in 1133ms (ActiveRecord: 37.8ms)
2016-03-27T04:49:33.187258+00:00 heroku[router]: at=info method=POST path="/users/confirmation" host=my-task-tracker.herokuapp.com request_id=3fa250b9-23e4-43f7-8e10-4f37e54d9a79 fwd="108.219.46.125" dyno=web.1 connect=1ms service=1162ms status=302 bytes=1245
2016-03-27T04:49:33.361655+00:00 app[web.1]: Started GET "/users/sign_in" for 108.219.46.125 at 2016-03-27 04:49:33 +0000
2016-03-27T04:49:33.372833+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2016-03-27T04:49:33.400388+00:00 app[web.1]:   Rendered devise/shared/_links.html.erb (1.3ms)
2016-03-27T04:49:33.400564+00:00 app[web.1]:   Rendered devise/sessions/new.html.erb within layouts/application (24.7ms)
2016-03-27T04:49:33.402011+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (0.6ms)
2016-03-27T04:49:33.402772+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.1ms)
2016-03-27T04:49:33.403290+00:00 app[web.1]: Completed 200 OK in 30ms (Views: 28.3ms | ActiveRecord: 0.0ms)
2016-03-27T04:49:33.376910+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=my-task-tracker.herokuapp.com request_id=72189b98-69bc-415f-ade7-a21856684a0a fwd="108.219.46.125" dyno=web.1 connect=5ms service=47ms status=200 bytes=4220
2016-03-27T05:23:51.692897+00:00 heroku[web.1]: Idling
2016-03-27T05:23:51.693798+00:00 heroku[web.1]: State changed from up to down
2016-03-27T05:23:57.760741+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-03-27T05:23:59.284360+00:00 app[web.1]:    /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `select'
2016-03-27T05:23:59.284343+00:00 app[web.1]: [2016-03-27 05:23:59] FATAL SignalException: SIGTERM
2016-03-27T05:23:59.284363+00:00 app[web.1]:    /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `block in start'
2016-03-27T05:23:59.284364+00:00 app[web.1]:    /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:32:in `start'
2016-03-27T05:23:59.284365+00:00 app[web.1]:    /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:162:in `start'
2016-03-27T05:23:59.284365+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:in `run'
2016-03-27T05:23:59.284367+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/server.rb:80:in `start'
2016-03-27T05:23:59.284366+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
2016-03-27T05:23:59.284367+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2016-03-27T05:23:59.284368+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
2016-03-27T05:23:59.284369+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2016-03-27T05:23:59.284369+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
2016-03-27T05:23:59.284370+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
2016-03-27T05:23:59.284390+00:00 app[web.1]:    bin/rails:9:in `require'
2016-03-27T05:23:59.284391+00:00 app[web.1]:    bin/rails:9:in `<main>'
2016-03-27T05:23:59.284464+00:00 app[web.1]: [2016-03-27 05:23:59] INFO  going to shutdown ...
2016-03-27T05:23:59.284516+00:00 app[web.1]: [2016-03-27 05:23:59] INFO  WEBrick::HTTPServer#start done.
2016-03-27T05:23:59.284544+00:00 app[web.1]: Exiting
2016-03-27T05:24:00.235601+00:00 heroku[web.1]: Process exited with status 143
2016-03-27T05:29:00.462487+00:00 heroku[web.1]: Unidling
2016-03-27T05:29:00.462791+00:00 heroku[web.1]: State changed from down to starting
2016-03-27T05:29:03.166146+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 18537 -e production`
2016-03-27T05:29:06.739510+00:00 app[web.1]: [2016-03-27 05:29:06] INFO  WEBrick 1.3.1
2016-03-27T05:29:06.739563+00:00 app[web.1]: [2016-03-27 05:29:06] INFO  ruby 2.2.4 (2015-12-16) [x86_64-linux]
2016-03-27T05:29:06.739784+00:00 app[web.1]: [2016-03-27 05:29:06] INFO  WEBrick::HTTPServer#start: pid=3 port=18537
2016-03-27T05:29:07.331731+00:00 heroku[web.1]: State changed from starting to up
2016-03-27T05:29:08.588190+00:00 heroku[router]: at=info method=GET path="/" host=my-task-tracker.herokuapp.com request_id=4343eecf-3333-496c-936d-9881c5d12412 fwd="108.219.46.125" dyno=web.1 connect=0ms service=92ms status=302 bytes=1122
2016-03-27T05:29:08.517272+00:00 app[web.1]: => Booting WEBrick
2016-03-27T05:29:08.517309+00:00 app[web.1]: => Rails 4.2.4 application starting in production on http://0.0.0.0:18537
2016-03-27T05:29:08.517311+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-03-27T05:29:08.517312+00:00 app[web.1]: => Ctrl-C to shutdown server
2016-03-27T05:29:08.517313+00:00 app[web.1]: Started GET "/" for 108.219.46.125 at 2016-03-27 05:29:08 +0000
2016-03-27T05:29:08.555988+00:00 app[web.1]: Processing by PagesController#index as HTML
2016-03-27T05:29:08.565676+00:00 app[web.1]: Completed 401 Unauthorized in 10ms (ActiveRecord: 0.0ms)
2016-03-27T05:29:08.953091+00:00 heroku[router]: at=info method=GET path="/users/sign_in" host=my-task-tracker.herokuapp.com request_id=69e03185-2d8f-41c5-ba23-d62fe66fdf6e fwd="108.219.46.125" dyno=web.1 connect=0ms service=57ms status=200 bytes=4002
2016-03-27T05:29:08.917010+00:00 app[web.1]: Started GET "/users/sign_in" for 108.219.46.125 at 2016-03-27 05:29:08 +0000
2016-03-27T05:29:08.919553+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2016-03-27T05:29:08.961087+00:00 app[web.1]:   Rendered devise/shared/_links.html.erb (2.9ms)
2016-03-27T05:29:08.961219+00:00 app[web.1]:   Rendered devise/sessions/new.html.erb within layouts/application (10.0ms)
2016-03-27T05:29:08.964675+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (1.4ms)
2016-03-27T05:29:08.965909+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.3ms)
2016-03-27T05:29:08.966140+00:00 app[web.1]: Completed 200 OK in 47ms (Views: 18.3ms | ActiveRecord: 5.9ms)
2016-03-27T05:29:09.845722+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=my-task-tracker.herokuapp.com request_id=5893b11b-579b-4937-9dc7-1b4b63c7ea3f fwd="108.219.46.125" dyno=web.1 connect=0ms service=4ms status=304 bytes=133

env/production.rb

config.action_mailer.default_url_options = { :host => 'https://my-task-    tracker.herokuapp.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
:address              => "smtp.gmail.com",
:port                 => 587,
:user_name            => ENV["GMAIL_USERNAME"],
:password             => ENV["GMAIL_PASSWORD"],
:authentication       => "plain",
:enable_starttls_auto => true
}

解决方案

You have to check two important things when you want to send emails via Gmail smtp:

  1. Your apps configuration:

    • host: smtp.gmail.com
    • port: 587 or 465 (587 for tls, 465 for ssl)
    • protocol: tls or ssl
    • user: YOUR_USERNAME@gmail.com
    • password: YOUR_PASSWORD
  2. The given Gmail account settings:

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

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