ActionMailer: end of file reached (EOFError)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ActionMailer: end of file reached (EOFError)

krfg

I am studying Peter Cooper's book Beginning Ruby.
According to the author ActionMailer can be used independently of Rails.
So I installed the ActionMailer gem in a dedicated gemset and wrote the code below which is an extract from the book:



require 'action_mailer' ActionMailer::Base.smtp_settings = { :address => "smtp.mail.yahoo.com", :port => 465, :authentication => :login, :user_name => "[hidden email]", :password => "password", :openssl_verify_mode => :ssl } class Emailer < ActionMailer::Base def test_email(email_address, email_body) mail(to: email_address, from: '[hidden email]', subject: 'action mailer test', body: email_body) end end Emailer.test_email('[hidden email]', 'This is a test e-mail!').deliver_now


When I run the rb file containing the above code I receive a long traceback (21 lines) with the following error message:

/home/krfg/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/protocol.rb:189:in `rbuf_fill': end of file reached (EOFError)


Why do I receive this error?
Also I tried run test_email on an instance of the class Emailer but I receive
undefined method `deliver_now' for #<Mail::Message:0x0000000002256b68>
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c03a598c-c38b-4c1c-9385-aa824bf7f304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActionMailer: end of file reached (EOFError)

David Merrick
EOF usually mean you reached the end of the file or are to read past it.

On Mon, May 7, 2018 at 7:19 PM, 'krfg' via Ruby on Rails: Talk <[hidden email]> wrote:

I am studying Peter Cooper's book Beginning Ruby.
According to the author ActionMailer can be used independently of Rails.
So I installed the ActionMailer gem in a dedicated gemset and wrote the code below which is an extract from the book:



require 'action_mailer' ActionMailer::Base.smtp_settings = { :address => "smtp.mail.yahoo.com", :port => 465, :authentication => :login, :user_name => "[hidden email]", :password => "password", :openssl_verify_mode => :ssl } class Emailer < ActionMailer::Base def test_email(email_address, email_body) mail(to: email_address, from: '[hidden email]', subject: 'action mailer test', body: email_body) end end Emailer.test_email('[hidden email]', 'This is a test e-mail!').deliver_now


When I run the rb file containing the above code I receive a long traceback (21 lines) with the following error message:

/home/krfg/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/net/protocol.rb:189:in `rbuf_fill': end of file reached (EOFError)


Why do I receive this error?
Also I tried run test_email on an instance of the class Emailer but I receive
undefined method `deliver_now' for #<Mail::Message:0x0000000002256b68>
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c03a598c-c38b-4c1c-9385-aa824bf7f304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dave Merrick

Daves Web Designs

Website http://www.daveswebdesigns.co.nz/

Email [hidden email]

Ph   03 216 2053

Cell 027 3089 169

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2B%3DMcKY5%3DpRLmLG0PAS-5Eb5L0h3SdNatYBLH%2BnWpOsVfmVUxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActionMailer: end of file reached (EOFError)

krfg


On Monday, May 7, 2018 at 10:37:36 AM UTC+2, David Merrick wrote:
EOF usually mean you reached the end of the file or are to read past it.

So why my code produces this error message?
I checked all the required ends: there are two, one for class Emailer and one for method test_email

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a62aab95-eadc-4b7d-9782-8e708e7b93f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActionMailer: end of file reached (EOFError)

krfg
Solved at Stackoverflow
https://stackoverflow.com/q/50201093/5078888

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9503cf7f-e007-497a-a847-7560cd09aacb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.