Thursday, April 19, 2012

Configure mailer with ruby

Hello Rubies,
    As we have to send the mail from rails application for that it requires to set the mailer configuration with rails.

First you have to install the package called 'sendmail'
sudo apt-get install sendmail

Now in environment.rb file of rails application set below code:

ActionMailer::Base.delivery_method = :sendmail

config.action_mailer.smtp_settings = {
  :address => "smtp.gmail.com",
  :port => 587,
  :domain => 'test.com',
  :authentication => :plain,
  :user_name => 'XYZ@gmail.com',
  :password => 'PWD' 
}

Hope this post will help you.

No comments:

Post a Comment