A
A
Alexander Petrov2016-08-09 09:22:00
Ruby on Rails
Alexander Petrov, 2016-08-09 09:22:00

Ruby on rails mailing not working?

The letter is not sent to production.
here are the logs:

ServiceMailer#service_email: processed outbound mail in 559.6ms
I, [2016-08-09T09:17:22.342131 #21410]  INFO -- : 
Sent mail to [email protected] (30010.3ms)
D, [2016-08-09T09:17:22.342267 #21410] DEBUG -- : Date: Tue, 09 Aug 2016 09:16:52 +0300
From: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Welcome to My Awesome Site
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
  <body>
    <!DOCTYPE html>
<html>
  <head>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
  </head>
  <body>
    <h1>Welcome!</h1>
    <p>
        Test message!  
    </p>
  </body>
</html>
  </body>
</html>

I, [2016-08-09T09:17:22.342553 #21410]  INFO -- : Completed 500 Internal Server Error in 30575ms (ActiveRecord: 0.0ms)
F, [2016-08-09T09:17:22.344503 #21410] FATAL -- : 
Net::OpenTimeout (execution expired):
  app/controllers/codes_controller.rb:43:in `show'

/app/mailers/service_mailer.rb
class ServiceMailer < ApplicationMailer
    
    default from: '[email protected]'
    
    
    def service_email()
        mail(to: '[email protected]', subject: 'Welcome to My Awesome Site')
    end

end

/app/views/service_mailer/service_email. html.erb
<!DOCTYPE html>
<html>
  <head>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
  </head>
  <body>
    <h1>Welcome!</h1>
    <p>
        Test message!  
    </p>
  </body>
</html>

and call in controller:
ServiceMailer.service_email().deliver_now

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Burmakin, 2016-08-09
@Freika

Net::OpenTimeout (execution expired):
  app/controllers/codes_controller.rb:43:in `show'

Have you tried reading the errors and looking where they point?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question