ruby - Sending smtp in rails using gmail -
i trying send activation email in development mode, using application.yml enter smtp credentials not sure missing reason i'm not able send activation email. here
application.yml
smtp_port: 587 smtp_domain: localhost:3000 smtp_address: smtp.gmail.com smtp_username: myemail@gmail.com smtp_password: myemailpassword smtp_authentication: 'plain' enable_starttls_auto: true
development.rb
config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :file config.action_mailer.file_settings = { location: 'tmp/mails' } config.action_mailer.default_url_options = { :host => env["url_host"] }
token_mailer.rb
def activation(email, token) @token_url = edit_activation_url token mail to: email end
use in development.rb
config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :user_name => "your mail", :password => "your password", :authentication => :plain, :enable_starttls_auto => true }
Comments
Post a Comment