Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created March 20, 2013 14:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vparihar01/5205286 to your computer and use it in GitHub Desktop.
Save vparihar01/5205286 to your computer and use it in GitHub Desktop.
Devise mailer configuration for registration email sending.
#Getting email unscrewed
#First configure Devise email in config/initializers/devise.rb:
config.mailer_sender = "vivek@yopmail.com"
#If you continue to get an error message, did you reboot the server?
#Localhost email testing
#Do this in the shell you’re using to run the Rails server:
#$ export GMAIL_SMTP_USER=username@gmail.com
#$ export GMAIL_SMTP_PASSWORD=yourpassword
#Add the following to config/environments/development.rb:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:authentication => :plain,
:domain => ENV['GMAIL_SMTP_USER'],
:user_name => ENV['GMAIL_SMTP_USER'],
:password => ENV['GMAIL_SMTP_PASSWORD'],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment