Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails ActionMailer-Net::OpenTimeout:执行已过期_Ruby On Rails_Ruby_Email_Timeout - Fatal编程技术网

Ruby on rails ActionMailer-Net::OpenTimeout:执行已过期

Ruby on rails ActionMailer-Net::OpenTimeout:执行已过期,ruby-on-rails,ruby,email,timeout,Ruby On Rails,Ruby,Email,Timeout,在rails 4.2.2和Ubuntu12.04中,我尝试使用实现电子邮件功能,现在,当我尝试通过rails控制台发送邮件时,出现如下错误: Net::OpenTimeout: execution expired from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize' from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1

在rails 4.2.2和Ubuntu12.04中,我尝试使用实现电子邮件功能,现在,当我尝试通过rails控制台发送邮件时,出现如下错误:

Net::OpenTimeout: execution expired
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `open'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `tcp_socket'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:551:in `block in do_start'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:550:in `do_start'
from /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/smtp.rb:520:in `start'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/mail-2.6.3/lib/mail/message.rb:2141:in `do_delivery'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/mail-2.6.3/lib/mail/message.rb:236:in `block in deliver'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/actionmailer-4.2.2/lib/action_mailer/base.rb:543:in `block in deliver_mail'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/notifications.rb:164:in `block in instrument'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.2/lib/active_support/notifications.rb:164:in `instrument'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/actionmailer-4.2.2/lib/action_mailer/base.rb:541:in `deliver_mail'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/mail-2.6.3/lib/mail/message.rb:236:in `deliver'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/actionmailer-4.2.2/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
from /home/shruthi/Projects/POC/file_system/app/models/email.rb:4:in `deliver_welcome_mail_to_user'
from (irb):2
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/commands/console.rb:110:in `start'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/commands/console.rb:9:in `start'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/shruthi/.rvm/gems/ruby-2.1.2/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
在mailer.rb中

class GeneralMailer < ActionMailer::Base

 default :from=> "shruthi@yandex.com"

 def welcome_email(user, password)
  @user = user
  @password = password
  mail(:to =>"shruthi@yopmail.com", :subject =>"Welcome") do |format|
  format.html { render :partial => "/emails/welcome", :layout=>false }
  end
 end

end
请帮助我解决此电子邮件问题

class GeneralMailer < ActionMailer::Base

 default :from=> "shruthi@yandex.com"

 def welcome_email(user, password)
  @user = user
  @password = password
  mail(:to =>"shruthi@yopmail.com", :subject =>"Welcome") do |format|
  format.html { render :partial => "/emails/welcome", :layout=>false }
  end
 end

end
mailer:
  service: smtp
  host: localhost:3000

sandmail:
  location:  '/usr/sbin/sendmail'
  arguments: '-i -t'

smtp:
  address: 'smtp.yandex.ru'
  domain:  'yandex.ru'
  port:    25

  email:   'shruthi@yandex.com'
  password: sss123@
  authentication: plain