Ruby on Rails
Monday, October 8, 2018
No, We're using AWS server, my client only providing :domain and :address
On Mon, Oct 8, 2018, 2:29 PM <faktsonly@gmail.com> wrote:
On Saturday, October 6, 2018 at 3:27:31 AM UTC-5, Prasanth Balan wrote:--Hi All,I need to configure SMTP on production,My client only providing address, is that possible without user_name & password to configure SMTP ?What is your host? If you are using Heroku you can configure SendGrid starter and it will provide a username and password for the mail server it creates for you.
Provision SendGrid likeheroku addons:create sendgrid:starter
Then grab your environment vars withheroku config:get SENDGRID_USERNAME
heroku config:get SENDGRID_PASSWORD
More information can be found here: https://devcenter.heroku.com/articles/sendgrid
To use the SMTP mailer you will need to setup an initializer class with something like the following:So, in config/initializers/setup_mail.rbActionMailer::Base.delivery_method = :smtpActionMailer::Base.smtp_settings = {:port => '587',:authentication => :plain,:user_name => ENV['SENDGRID_USERNAME'],:password => ENV['SENDGRID_PASSWORD'],:enable_starttls_auto => true}Create a mailer template and invoke from your controller of choice and you've got a working mail in production.
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/8e4fac18-7433-44d6-bb7f-d67b6e49c552%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/CAEOjMEKciuJhfW%3DJSi%3DghasWrxkUyRrhg9FCDhvLZTe9ZQLmgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment