Sinatra电子邮件Net :: OpenTimeout-执行到期

时间:2018-10-11 19:38:09

标签: ruby sinatra

关于此的其他一些文章,但是在尝试了这些解决方案之后,什么也没有发生。我尝试了两种不同的邮件,它们的反应都相同。这是我的邮件文件:

 Pony.mail({
   :to => 'Iexist_tester@yahoo.com',
   :via => :smtp,
   :via_options => {
     :address        => 'smtp.gmail.com',
     :port           => '587', #also 465
     :ssl => true,
     :user_name      => 'MY-USEMERNAME@gmail.com',
     :password       => 'MY-PW',
     :authentication => :plain, # :plain, :login, :cram_md5, no auth by default
     :domain         => "localhost.localdomain" # the HELO domain provided by the client to the server
   }

 })
 puts('after')

它永远不会到达puts的结尾。我知道这些凭据有效,因为我已经在Flask应用程序中设置了此地址,并且可以正常工作。不知道该领域中发生了什么,但似乎没有任何改变。即使输入不正确的数据(例如伪造的PW)也不会更改错误。尽管该函数正在运行,但整个日志仍会触发。 完整的堆栈跟踪:

/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/resolv-replace.rb in initialize
    original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/resolv-replace.rb in initialize
    original_resolv_initialize(IPSocket.getaddress(host), serv, *rest)
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/smtp.rb in open
      TCPSocket.open address, port
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/smtp.rb in tcp_socket
      TCPSocket.open address, port
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/smtp.rb in block in do_start
        tcp_socket(@address, @port)
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/timeout.rb in timeout
        bl.call(klass)
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/smtp.rb in do_start
      s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
/Users/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/smtp.rb in start
          do_start helo, user, secret, authtype
server.rb in block in <main>

也许这是倒数第二行吗?如果是这样,那意味着什么?

0 个答案:

没有答案