Ruby on Rails Friday, September 15, 2017

OK, been trying to get my SMTP settings correct in the action Mailer for about 4 hours now and running out of ideas.  The problem is that whatever I do I cant find any errors in logs but also don't get any emails.  So I tried doing it in 'rails console', but still not getting any errors (or emails).  This is what I am doing in the console.  I should add I am doing this on my ISPs server (through ssh) and I use there SMTP server every day so I am fairly sure it is set up properly;)

Setting details up in ActionMailer

ActionMailer::Base.smtp_settings = {      user_name:      'username',      password:       'password',      domain:         'mail.xtreamlab.net',      address:        'mail.xtreamlab.net',      port:           '25',      authentication: :plain,      enable_starttls_auto: true  }

console response

=> {:user_name=>"username", :password=>"password", :domain=>"mail.xtreamlab.net", :address=>"mail.xtreamlab.net", :port=>"993", :authentication=>:plain, :enable_starttls_auto=>true}

then I setup delivery method:

ActionMailer::Base.delivery_method = :smtp

console response

=> :smtp

and setup a method to send the email

class MyMailer < ActionMailer::Base
  def test_email
    @recipients = "myaddress@funkytwig.com"
    @from = "someaddress@eventpuddle.com"
    @subject = "This is a subject"
    @body = "This is the body"
  end
end

console response

=> :test_email

then tried to send the email

MyMailer.test_email

console response

MyMailer#test_email: processed outbound mail in 3.0ms  (Object doesn't support #inspect)  => 

Looked in the rails log file and all seems OK.  so I thought maybe this is not actually telling me it has worked, so I changed the password to something random and very wrong and exactly the same happened, so it is not telling me it has worked.....or giving me a error;(

I've tried this on my ISPs server and my development computer and I have run out of ideas, I really don't know what to try next.






--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d5919c37-46a4-4052-89c8-506c8f0aa20f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment