Rails 2.3.9和SendGrid,连接被拒绝

编程入门 行业动态 更新时间:2024-10-27 16:37:26
本文介绍了Rails 2.3.9和SendGrid,连接被拒绝-本地主机上的connect(2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经查看了Google和StackOverflow,无法解决这个问题。

I've looked through Google and StackOverflow and can't figure this out.

我有一个使用Ruby 1.8.7的Rails 2.3.9应用程序,尝试像这样通过SMTP发送电子邮件:

I've got a Rails 2.3.9 app using Ruby 1.8.7, trying to send email through SMTP like so:

ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid", :port => '25', :domain => "************", :authentication => :plain, :user_name => "***********", :password => "**********" }

我的应用回溯看上去像这样:

My app backtrace looks like this:

/Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in `initialize' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in `open' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in `do_start' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:67:in `timeout' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:101:in `timeout' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:551:in `do_start' /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/smtp.rb:525:in `start' /Users/jared/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.3.9/lib/action_mailer/base.rb:682:in `perform_delivery_smtp' /Users/jared/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.3.9/lib/action_mailer/base.rb:523:in `__send__' /Users/jared/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.3.9/lib/action_mailer/base.rb:523:in `deliver!' /Users/jared/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.3.9/lib/action_mailer/base.rb:429:in `deliver' /Users/jared/rails/********/app/models/user.rb:160:in `send_welcome_email' /Users/jared/rails/*********/app/controllers/users_controller.rb:35:in `create'

推荐答案

我知道了。我的ISP阻止了端口25,所以我不得不更改配置:

I figured it out. My ISP was blocking port 25, so I had to change my configuration:

ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid", :port => '587', :domain => "**********", :authentication => :plain, :user_name => "************", :password => "*********", :enable_starttls_auto => true }

更多推荐

Rails 2.3.9和SendGrid,连接被拒绝

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

发布评论

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

>www.elefans.com

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