Ruby on Rails Friday, September 29, 2017

Not read the guide but I simply set up the details of my outgoing SMTP server in my config/enviroments/production.rb (and development.rb), something like

  config.action_mailer.perform_deliveries = true
  config.action_mailer.smtp_settings = {
    user_name:            Rails.application.secrets.mail_username,
    password:             Rails.application.secrets.mail_password,
    domain:               'mydomain.com',
    address:              'mail.myhostingpeople.net',
    port:                 '25',
    authentication:       :login,
    enable_starttls_auto: true
  }

Bear in mind that even  on development you need to restart 'rails s' to reload this.

The guide sounds a bit over complicate.  I setup my mail using the instructions in http://codepany.com/blog/rails-5-user-accounts-with-3-types-of-roles-devise-rails_admin-cancancan/.  Its actually a very good guide about setting up user/authentication but the mail bit can looked at on its own.

If you are using Linux and just want to send email ssmtp is worth a look, its VERY simple to set up (I use it on production servers).


On Thursday, September 28, 2017 at 8:36:43 AM UTC+1, Aqib Hameed wrote:
I am following this rails guide http://guides.rubyonrails.org/action_mailer_basics.html#receiving-emails. But i am not able to understand what should it means
"Configure your email server to forward emails from the address(es) you would like your app to receive to /path/to/app/bin/rails runner 'UserMailer.receive(STDIN.read)'."
Is there any screen-cast which explain these things ???

--
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/2727f738-e1c8-47e0-968d-7bc9835d8a3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment