Skip to content

Instantly share code, notes, and snippets.

@bagwanpankaj
Created October 19, 2010 09:06
Show Gist options
  • Save bagwanpankaj/633886 to your computer and use it in GitHub Desktop.
Save bagwanpankaj/633886 to your computer and use it in GitHub Desktop.
Gmail SMTP Conf with Rails
development:
enable_starttls_auto: true
address: "smtp.gmail.com"
port: 587
domain: 'http://'
authentication: plain
user_name: "user@domain_name"
password: your-password
production:
enable_starttls_auto: true
address: "smtp.gmail.com"
port: 587
domain: 'http://'
authentication: plain
user_name: "user@domain_name"
password: your-password
# Load mail configuration if not in test environment
if RAILS_ENV != 'test'
email_settings = YAML::load(File.open("#{RAILS_ROOT}/config/mailer_settings.yml"))
ActionMailer::Base.smtp_settings = email_settings[RAILS_ENV] unless email_settings[RAILS_ENV].nil?
end
gem install ambethia-smtp-tls
#make dependencies
#in "#{RAILS_ROOT}/config/environment.rb" write the following
config.gem "ambethia-smtp-tls", :lib => "smtp-tls", :source => "http://gems.github.com/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment